We use VSTS to deploy an ARM template. (Azure Deployment task version: 2). In this task, we can configure the output variable. The will output the json output of the ARM template in this variable. In my case, it is called armOutputJson.
In the next task, I have an inline powershell script that tries to convert this value to a powershell object.
$outputObject = ConvertFrom-Json -InputObject @"
$(armOutputJson)
"@
Write-Host "##vso[task.setvariable variable=armOutput]"$outputObject
Write-Host $outputObject
The output seems to written to the host like this:
@{storageAccountName=; functionAppName=}
It looks like the settings are not correctly parsed? Also when trying to access this variable in my deploy task using $(armOutput).functionAppName.value, I got the following error:
[error]Error: Resource '@{storageAccountName=; functionAppName=}.functionAppName.value' doesn't exist. Resource should exist before deployment.
Anyone knows how I can parse the output json to a vsts variable and use it in another task?