Hey I am doing a CI/CD deployment for a logic app, I have a table storage where I store some data, I have two table storage for test and prod environment. I created a parameter called *table_storage_name" in ARM template :
"parameters": {
// ....
"connections_azuretables_1_externalid": {
"defaultValue": "/subscriptions/e5..../resourceGroups/myrg.../providers/Microsoft.Web/connections/azuretables-1",
"type": "String"
},
"table_storage_name": {
"defaultValue": "testdevops",
"type": "String"
}
}
The error comes from when I reference the parameter here in template.json file:
// ...
"Insert_Entity": {
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"body": {
"PartitionKey": "@body('Parse_JSON')?['name']",
"RowKey": "@body('Parse_JSON')?['last']"
},
"host": {
"connection": {
"name": "@parameters('$connections')['azuretables_1']['connectionId']"
}
},
"method": "post",
// problem occur after this line
"path": "/Tables/@{encodeURIComponent('[parameters('table_storage_name')]')}/entities"
}
}
but get this error:
InvalidTemplate: The template validation failed: 'The template action 'Insert_Entity' at line '1' and column '582' is not valid: "Unable to parse template language expression 'encodeURIComponent([parameters('table_storage_name')])': expected token 'Identifier' and actual 'LeftSquareBracket'.".'.
I tried escaping the quote with a backslash like: encodeURIComponent('[parameters('table_storage_name')]')
or encodeURIComponent('[parameters(''table_storage_name'')]')
but all of them raise an error. How can I reference a paramter inside encodeURIComponent in an ARM template ?
question from:
https://stackoverflow.com/questions/65887464/unable-to-parse-template-language-expression-encodeuricomponentparametersta 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…