I use the ARM template deployment task in my release pipeline. The task has a parameter called Location
.
In my parameters.json file, I also have a parameter called Location
. How could I change this file so that it reads the value set on the task itself ?
Currently the value is read from a variable group's variable coming from azure keyvault. But I think it's overkill to have this location parameter coming from the vault.
Based on my test, I notice that the value in xxx.parameters.json couldn't read the value of the variable in pipeline.
For example:
I set the variable(test : abc) in Pipeline variables. Then I use it in the xxx.parameters.json file. When the Resource group creates, the vaiable doesn't be read in the resource group.
The parameters.json sample:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"value": "test"
},
"location": {
"value": "$(test)"
}
}
}
From the result, it seems that the location value couldn't be automatic used in the json file.
You may need to use the tokenizer
task to manually override the specific value in the json file. Then the value could be used in the resource group.
Or you could directly use the Override template parameters
in the ARM Template task.
Hope this could help.