Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure pipelines 我如何引用和设置一个;“每次运行”;我的Azure管道中的变量YAML?_Azure Pipelines - Fatal编程技术网

Azure pipelines 我如何引用和设置一个;“每次运行”;我的Azure管道中的变量YAML?

Azure pipelines 我如何引用和设置一个;“每次运行”;我的Azure管道中的变量YAML?,azure-pipelines,Azure Pipelines,我正在创作一个Azure管道YAML文件。我希望在管道运行时从“外部”发送一个值。我该怎么做 我读过这个文档,但它太密集了,或者我太密集了,我发现很难辨别我的简单用例 在YAML中,使用语法$(myVariableName)。您可以将其连接为字符串值 下面是一个例子: - task: AzurePowerShell@4 displayName: Deploy ARM template inputs: inline: 'New-AzResourceGroupDeployment -

我正在创作一个Azure管道YAML文件。我希望在管道运行时从“外部”发送一个值。我该怎么做

我读过这个文档,但它太密集了,或者我太密集了,我发现很难辨别我的简单用例


在YAML中,使用语法
$(myVariableName)
。您可以将其连接为字符串值

下面是一个例子:

- task: AzurePowerShell@4
  displayName: Deploy ARM template
  inputs:
    inline: 'New-AzResourceGroupDeployment -ResourceGroupName $(azureResourceGroup) -TemplateFile $(System.DefaultWorkingDirectory)/build/$(armTemplateJsonFileName)'
  ...
然后,可以根据下面的屏幕截图在管道的web UI中配置变量
azureResourceGroup
armTemplateJsonFileName
。当管道运行时,它将变成一个环境变量,因此您运行的任何脚本都可以访问它


在YAML中,使用语法
$(myVariableName)
。您可以将其连接为字符串值

下面是一个例子:

- task: AzurePowerShell@4
  displayName: Deploy ARM template
  inputs:
    inline: 'New-AzResourceGroupDeployment -ResourceGroupName $(azureResourceGroup) -TemplateFile $(System.DefaultWorkingDirectory)/build/$(armTemplateJsonFileName)'
  ...
然后,可以根据下面的屏幕截图在管道的web UI中配置变量
azureResourceGroup
armTemplateJsonFileName
。当管道运行时,它将变成一个环境变量,因此您运行的任何脚本都可以访问它