我想在我的VM上安装azure代理,并使其显示为环境资源,如下所述: docs.microsoft/zh-cn/azure/devops/pipelines/process/environments-virtual-machines?view= azure-devops .
I want to install an azure agent onto my VM and have it appear as an Environment resource as described here: docs.microsoft/en-us/azure/devops/pipelines/process/environments-virtual-machines?view=azure-devops .
如果您以交互方式运行脚本,则此方法有效,但是当我使用-无人参与时(如此处所述: docs.microsoft/zh-cn/azure/devops/pipelines/agents/v2-windows?view = azure-devops#unattended-config ),因此无法再指定标签.-addDeploymentGroupTags 选项不适用于环境代理.
This works if you run the script interactively, however when I use --unattended (as described here: docs.microsoft/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops#unattended-config ) there is no longer a way to specify tags. The --addDeploymentGroupTags option doesn't work with Environment agents.
如何使用标签自动将VM添加为环境资源?
How do I automate the adding of a VM as an environment resource with tags?
推荐答案我看了一下源代码,发现有一个未记录的方法可以做到这一点.只需使用以下命令:
I had a look at the source code and figured out there is an undocumented way to do this. Just use the following commands:
-addvirtualmachineresourcetags --virtualmachineresourcetags< tag>"
更多推荐
部署到环境VM资源时标记Azure DevOps代理
发布评论