I’m trying to pass variables from an ARM template output step to a powershell step, but the PowerShell thinks the template value is empty, so the powershell fails.
“value”: “[resourceId(resourceGroup().name,‘Microsoft.Web/sites’, variables(‘webSiteName’))]”
Step name in Octopus is: “deploy-web-app”
PowerShell Script is:
$endpoint = $OctopusParameters[“Octopus.Action[deploy-web-app].Output.AzureRMOutputs[WebSiteResourceId]”]
Write-Host "Adding endpoint " $endpoint
The $endpoint is empty
What am I doing wrong?
Thanks for reaching out. I’m afraid that catching the output of an ARM template like that is not possible at the moment. Feel free to add it as a uservoice suggestion to see if the community would find this enhancement useful: http://octopusdeploy.uservoice.com/
Umm… majorly confused here.
Last section states:
Accessing ARM template output parameters
Any outputs from the ARM template step are made available as Octopus output-variables automatically. For example, an output
Foo would be available as:
Which bit is not possible?
also interested in this exact situation.
Any update on this? To be frank User Voice is usually a place where ideas go to die… and from the documentation this actually appears to be a bug?
Sincere apologies for the delay on this. I’ve just setup a test and the output variables do get handled and passed in to subsequent step correctly.
To troubleshoot why it might not be working for you, could I get you to check the output from the Resource Group step? There should be a line right near the end that reads “Provisioning State: Succeeded”. If you view the Verbose output then just below this should be the json for the template output. Does that appear and does it have the correct values substituted in?
If you have a variable in the project called OctopusPrintVariables that is set to True, then in the Verbose output for the second step you should be able to see the variable values being passed in. To find the one I’m after I typically expand any “additional lines not shown” sections and then text search the page for the variable name, e.g. WebSiteResourceId in your scenario. Can you find the variable in the list and if so is it’s value correct? If it is there and correct, could you also double check that the full name being passed in is Octopus.Action[deploy-web-app].Output.AzureRMOutputs[WebSiteResourceId]?
Again, apologies for the delay.
Can confirm that we have output variables functioning as expected.
Using the “Deploy Azure Resource” step, where you specify a template and params.json file.
I will get round to this shortly, it’s on my TODO list