In your YAML, use the syntax $(myVariableName)
. You can concatenate this into string values.
Here's an example:
- task: AzurePowerShell@4
displayName: Deploy ARM template
inputs:
inline: 'New-AzResourceGroupDeployment -ResourceGroupName $(azureResourceGroup) -TemplateFile $(System.DefaultWorkingDirectory)/build/$(armTemplateJsonFileName)'
...
The variables azureResourceGroup
and armTemplateJsonFileName
can then be configured within the web UI of the Pipeline as per the screenshot below. It will turned into an environment variable when the pipeline runs, so its also accessible to any scripts you run.