简体   繁体   English

远程创建 azure devops windows 自托管代理

[英]create azure devops windows self hosted agent remotely

Need to create azure devops windows self-hosted agents programmatically (Need to install Remotely for the existing VM).需要以编程方式创建 azure devops windows 自托管代理(需要为现有 VM 远程安装)。

I have PS script and it is working well if i run it (as admin) inside the virtual machine and agent is getting installed successfully.我有 PS 脚本,如果我在虚拟机中运行它(以管理员身份)并且代理安装成功,它运行良好。 But i want to create this agent for the existing VM without logging in (Remotely i need to install the agent), because i will need to just add the ARM template in Azure devops pipeline and that should create the Agent for the existing VM.但是我想在不登录的情况下为现有 VM 创建此代理(我需要远程安装该代理),因为我只需要在 Azure devops 管道中添加 ARM 模板,这应该为现有 VM 创建代理。

As this needs to be installed remotely and securely, i shouldn't use custom script due to some restrictions.. It would be really great if we can achieve this installation remotely without custom script and using any other automated way .由于这需要远程安全安装,由于某些限制,我不应该使用自定义脚本。如果我们可以在没有自定义脚本并使用任何其他自动化方式的情况下远程实现此安装,那将是非常棒的

Any information will be helpful, thanks.任何信息都会有所帮助,谢谢。

I have found out a way using Run-Command.我找到了一种使用 Run-Command 的方法。 This is another helpful option to run the PS scripts remotely on a Virtual machine.这是在虚拟机上远程运行 PS 脚本的另一个有用选项。 In addition, this executes the script with elevated permissions which is really helpful in many scenarios.此外,这会以提升的权限执行脚本,这在许多情况下非常有用。

Source: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command#powershell来源: https : //docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command#powershell

This can be performed using via Portal, Powershell and CLI as well.这也可以通过 Portal、Powershell 和 CLI 执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在自托管的 Windows 代理中安装 Liquibase? (Azure Devops 管道) - How to install Liquibase in a self hosted Windows agent ? (Azure Devops Pipeline) 如何在自托管 Windows 代理上从 Azure DevOps 管道运行 Azure CLI 任务? - How to run Azure CLI tasks from an Azure DevOps Pipeline on a Self-Hosted Windows Agent? Azure DevOps self hosted windows agent to Azure Linux function app deployment - Azure DevOps self hosted windows agent to Azure Linux function app deployment 在自托管的 Azure DevOps Agent 上安装 ChromeDriver - Installing ChromeDriver on self-hosted Azure DevOps Agent Azure 用于 Java 项目的 DevOps 管道,带有自托管代理 - Azure DevOps Pipeline for Java Project with self hosted agent 将自托管建筑代理重定向到 Azure Devops 服务 - Redirect Self-Hosted Building Agent to Azure Devops Service Azure DevOps 自托管代理错误连接问题 - Azure DevOps Self hosted agent error connectivity issues Terraform INIT 失败并出现 azure 在 ACI 上开发自托管代理 - Terraform INIT failing with azure Devops self hosted agent on ACI azure 使用自定义映像开发自托管容器代理 - azure devops self hosted container agent with custom image Azure DevOps 托管代理未能拉取 windows:2004 - Azure DevOps hosted-agent failed to pull windows:2004
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM