如何在接下来的任务中访问 Azure ARM 的输出参数?

How to Access Output Parameters from Azure ARM in next Tasks?

我正在为我的 Azure 基础设施编写 ARM 脚本。我的 ARM

中有样本输出变量
"OutputVariables": [{
    "name" : "MY_OUTPUTVARIABLE_1",
    "description" : "This is the description of my output variable."
}, 
{
    "name" : "MY_OUTPUTVARIABLE_2",
    "description" : "Description can contains markdown [vsts-tasks](https://github.com/microsoft/vsts-tasks)"
}]

我想在我的 VSTS 发布任务的下一个任务中访问这些 ARM 输出变量。

我无法访问变量 MY_OUTPUTVARIABLE_1。

请建议如何使用 ARM 输出变量。

谢谢

This article 向您展示了如何在 VSTS 中解析输出变量。您需要确保将它们定义为任务的输出,以便 VSTS 知道要查找的内容。这可以在任务底部的输出变量部分找到。

如果未在管道中初始化,则无法找到。另外值得注意的是,您提供的 ARM 模板实际上并未为参数设置值。 The ARM documentation 显示设置输出变量的正确方法。

"outputs": {
"resourceID": {
  "type": "string",
  "value": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_name'))]"
  }
}

希望对您有所帮助。