问题
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:
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:
Test with Script File:
来源:https://stackoverflow.com/questions/63143746/how-can-you-use-secret-variables-from-a-linked-variable-group-in-an-azure-powers