My question is an extension to this question: How to add env vars into Azure Devops pipeline
@Krzysztof Madej answer is correct, but I want to know if the secret env var that you're passing isn't defined in the variable group yet, what does it default to?
- task: Bash@3
displayName: Running bash step
inputs:
targetType: "inline"
workingDirectory: "xxx"
script: |
az login --identity --username $(ARM_CLIENT_ID)
env:
ARM_CLIENT_ID: $(ARM_CLIENT_ID)
In my case, if I forgot to set ARM_CLIENT_ID
in the ADO variable group, what is the default value in the pipeline going to be?
Standard expectation is an empty string or null value. But I'm seeing the bahaviour that the default is actually the literal string of the variable name ie. "$(ARM_CLIENT_ID)" in this case.
I haven't been able to find documentation at that level of detail. Has anyone come across this?
This is the closest I found https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/bash-v3?view=azure-pipelines#examples