I have quite strange behavior with deploying arm
template.
I create a json
like:
tags=$( echo '{"key1": "value1", "key2": "value2", "key3": "value3"}' )
also, tried just:
tags='{"key1": "value1", "key2": "value2", "key3": "value3"}'
then I want to provide this as argument to my deployment command:
az deployment group create --resource-group $gn
--name $dn
--template-file $armTemplatePath
--parameters $armTemplateParams
--parameters subscriptionId=$sub
--parameters name=$name
--parameters resourceGroupName=$gn
--parameters location=$loc
--parameters hostingPlanName=$hp
--parameters serverFarmResourceGroup=$sfrg
--parameters resourceTags=$tags
but I constantly receive the error:
Tags ***"key1": "value1", "key2": "value2", "key3": "value3"***
apparently, the symbols {
and }
are getting replaced on ***
. I know sometimes such logic can hide secrets in github actions, but not sure what’s the deal here. How to provide tags in my case (I tried different ways including env variables which gets the same result)?
note: this is how tags
are defined in template.json
:
"resourceTags": {
"type": "object",
"defaultValue": {
}
}
and then in resource definition:
...
"tags": "[parameters('resourceTags')]",
...
8
You should be able to achieve it like this:
--parameters resourceTags="$tags"
Complete JSON string will be sent as a single token.