Passing only one specific json key-value as parameters for az cli #7418
-
Hi there, So my parameters.json has this object that i will use later to populate my azure container instance.
When i do my deployment, i want to be able to use the parameters.json params values but i want to also retreive my AZP_TOKEN out from the variable library to charge it into the environmentVariables. is this even doable ? i dont see how i can catch the right positional value in the object! ERROR: Failed to parse JSON: az deployment group create --resource-group arg-rt-idev-cloudeng-jla --template-file main.bicep --parameters parameters.json --parameters environmentVariables="$AZP_TOKEN" thanks a lot, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
I think it will be best to use a different parameter to pass in the token. you could make it a secure string parameter. Then you could use either union() or replacement strings to update the value. Here is a sample of using replacement strings in Azure Container Groups. https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/ACI-ACI.bicep#L49 You can use something similar to this in the actual parameter file. "AZP_TOKEN" : "{replace}" |
Beta Was this translation helpful? Give feedback.
I think it will be best to use a different parameter to pass in the token. you could make it a secure string parameter.
Then you could use either union() or replacement strings to update the value.
Here is a sample of using replacement strings in Azure Container Groups.
https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/ACI-ACI.bicep#L49
You can use something similar to this in the actual parameter file.
"AZP_TOKEN" : "{replace}"