0
votes

I have an Azure Release pipeline that I've built using the GUI in Azure DevOps. There is a stage that has a linked variable group (Release scope) with a secret variable in the variable group. The stage has an agent job with an Azure Powershell task that runs a script file. That script file references the secret variable using the syntax $env:MYSECRETVARIABLE but the value is null. When I add an Azure Powershell task for debugging that runs Get-ChildItem -Path Env:\, I can see that all the non-secret variables in the variable group are mapped but the secret variable is not. What am I doing wrong here?

1

1 Answers

3
votes

I tested to get the secret variable in the variable group in azure powershell task, just use the syntax of $(varibaleName) to work.

Test with inline script:

enter image description here

enter image description here

enter image description here

Test with Script File:

enter image description here

enter image description here

enter image description here