部署到环境VM资源时标记Azure DevOps代理

编程入门 行业动态 更新时间:2024-10-26 22:24:43
本文介绍了部署到环境VM资源时标记Azure DevOps代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在我的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代理

本文发布于:2023-11-16 19:37:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607184.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标记   环境   资源   DevOps   VM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!