简体   繁体   English

如何将 azure cli 变量传递给 Azure Devops 变量?

[英]How can i pass an azure cli variable to Azure Devops variables?

I have written an Azure cli task in Azure Devops as below我在 Azure Devops 中编写了一个 Azure cli 任务,如下所示

$vnetid = $(az network vnet show -n $vnet -g $(rg) --query id --output tsv) $vnetid = $(az network vnet show -n $vnet -g $(rg) --query id --output tsv)

I want to output the $vnetid to the Azure Devops Variables so it can be used in another task how can i do this?我想要 output 的 $vnetid 到 Azure Devops 变量,所以它可以用于另一个任务我该怎么做?

I guess you can simply do我想你可以简单地做

Write-Output("##vso[task.setvariable variable=vnetid;]$$vnetid")

暂无
暂无

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

相关问题 在 Azure Devops 中,如何在运行 shell 脚本的“Azure CLI task v.2”中使用管道变量? - In Azure Devops, how can i use pipeline variables in a “Azure CLI task v.2” running shell script? 如何在 Azure Devops/VSTS 中的任务之间传递变量 - How can i pass a variable between tasks in Azure Devops/VSTS 如何将 map 变量传递给 Azure Devops 管道作业? - How can I pass map variable to Azure Devops pipeline job? 如何在通过 Azure DevOps 管道在 Azure Webapp 上部署容器映像时传递动态变量/秘密? - How can i pass dynamic variables/secrets while deploying container image on Azure Webapp through Azure DevOps pipeline? 如何将变量传递给 azure devops 管道中的 SqlAzureDacpacDeployment@1 任务 - How can I pass a variable to the SqlAzureDacpacDeployment@1 task in azure devops pipeline 如何将变量传递给 Azure DevOps 运行管道 - How to pass variable to Azure DevOps Run Pipeline 用 azure devops 中的变量替换变量 - Substitute variables with variable in azure devops 在 DevOps 中将参数传递给 Azure CLI 任务 - Pass parameter to Azure CLI Task in DevOps 如何在 Devops 发布管道中的 Azure CLI 脚本中使用变量 - How to use variable in Azure CLI script within Devops release Pipeline 在 azure devops 中:将 docker 容器部署到 azure 时,如何将我的管道变量作为 appsettings 注入? - In azure devops: how can I inject my pipeline variables as appsettings when deploying a docker container to azure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM