I'm creating an Azure resource template and getting this validation error when I specify tags:
New-AzureResourceGroupDeployment : Error 1: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template resource 'hosting-plan' at line '86' and column '10' is not valid: Template language expression '[parameters('intranetConnectivity')]' is not supported..'.
Here's the relevant section of the template:
"parameters": {
"intranetConnectivity": {
"type": "bool",
"defaultValue": false
},
...
}
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('siteLocation')]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
"ServiceModel": "[parameters('serviceModel')]",
"IntranetConnectivity": "[parameters('intranetConnectivity')]",
"Environment": "[parameters('environment')]"
},
I thought maybe the parameter name was too long, but I get the same error regardless of the parameter name.
It turned out that it didn't like me using a boolean parameter in a string value. I changed the parameter definition to string and everything works.