Reputation: 1728
Here's the Azure CLI command I'm using:
az deployment group create --resource-group example_rg_name --template-file arm_templates/my_project_folder/template.json --no-prompt
Here's the resulting error:
InvalidTemplate - Deployment template validation failed: 'The value for the template parameter 'location' at line '5' and column '21' is not provided. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
Here is the allegedly invalid line 5:
1 {
2 "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 "contentVersion": "1.0.0.0",
4 "parameters": {
5 "location": {
6 "type": "String"
7 },
...
Indeed, the value for location here only includes the type. HOWEVER, the location IS present in the parameters.json file, see line 6 below:
1 {
2 "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3 "contentVersion": "1.0.0.0",
4 "parameters": {
5 "location": {
6 "value": "westus2"
7 },
And notice how this value is referenced in the template.json file, for example line 51 below:
46 "resources": [
47 {
48 "type": "Microsoft.Databricks/workspaces",
49 "apiVersion": "2018-04-01",
50 "name": "[parameters('workspaceName')]",
51 "location": "[parameters('location')]",
52 "dependsOn": [
Do I need to hard code the values in place of these references? This template and parameters file were exported from Azure after manually creating the service, which by the way is a databricks service.
Any hints as to what I'm missing here?
THANKS
Upvotes: 0
Views: 1083
Reputation: 11008
You need to reference your parameters file when creating the deployment.
az deployment group create --resource-group example_rg_name --template-file arm_templates/my_project_folder/template.json --parameters @parameters.json --no-prompt
Upvotes: 1