Open tonesandtones opened 4 years ago
There you go. I've raised a PR to add to the script so that the full object is outputted as individual parameters.
This means that the object:
{
"test": {
"type": "String",
"value": "my_storage"
},
"storageAccountKey":
{
"type": "String",
"value": "Hello!"
},
"storageAccountContainer":
{
"type": "String",
"value": "backup"
}
}
Will become:
"OutputVar.test.type" = "String"
"OutputVar.test.value" = "my_storage"
"OutputVar.storageAccountKey.type" = "String"
"OutputVar.storageAccountKey.value" = "Hello!"
"OutputVar.storageAccountContainer.type" = "String"
"OutputVar.storageAccountContainer.value" = "backup"
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Feature
Enter Task Name: AzureResourceGroupDeploymentV2 and AzureResourceManagerTemplateDeploymentV3
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzureResourceGroupDeploymentV2 https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzureResourceManagerTemplateDeploymentV3
Environment
Server - Azure Pipelines
Agent - Hosted
Issue Description
As a pipeline yml author, I would like a simple way to make ARM template outputs available as pipeline variables.
Azure ARM deployment tasks do not provide the ability to unwrap template outputs and set them as pipeline variables. The readme for https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzureResourceManagerTemplateDeploymentV3 even offers a Powershell snippet for doing this.
It should not be necessary to add a separate script/pwsh/powershell step to unwrap the outputs section to make ARM outputs available as pipeline variables. Script snippets like this are easy to get wrong and difficult to get right across the various agent OSes and ARM output variable types.
I propose adding a boolean parameter to control the behaviour, such as
expandDeploymentOutputAsVariables: true
. When set to true, all output variables from the ARM template execution are set as pipeline variables, similar to if you included a script snippet like the above example.Task logs
n/a - feature request
Troubleshooting
n/a - feature request
Error logs
n/a - feature request