I'm deploying Automation Account resources using ARM and when i try to add a automation account variable (under "resources") i get the error message "Invalid JSON - Kindly check the value of the variable."
The code part is this and it works fine without the automation account variable:
{
"condition":"[parameters('deploy.AUTOMATION')]",
"type":"Microsoft.Automation/automationAccounts",
"apiVersion":"2021-06-22",
"name":"[variables('automationaccount').accountName]",
"location":"[variables('automationaccount').location]",
"dependsOn":[
"[variables('automationaccount').operationalInsightsWorkspaceName]"
],
"identity":{
"type":"SystemAssigned"
},
"properties":{
"sku":{
"name":"[variables('automationaccount').skuName]"
},
"disableLocalAuth":true,
"publicNetworkAccess":"[variables('automationaccount').publicNetworkAccess]"
},
"resources":[
{
"type":"variables",
"apiVersion":"2020-01-13-preview",
"name":"DummyName",
"dependsOn":[
"[variables('automationaccount').accountName]"
],
"properties":{
"description":"Dummydesc",
"isEncrypted":false,
"value":"DummyValue"
}
}
],
"tags":"[parameters('tags')]",
"comments":""
}
Any ideas what's wrong?
Documentation for Microsoft.Automation automationAccounts/variables https://learn.microsoft.com/en-us/azure/templates/microsoft.automation/automationaccounts/variables?pivots=deployment-language-arm-template
I'm expecting the automation account variable to be created. I've tried to deploy the stated code in Azure Cloud shell (as part of a longer script defining parameters and variables etc).
I've also tried to write the automation account variable as an outside parent resource and get the same error.
BR Edvin