Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
deploy a resource with an expression for the type property
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"type": {
"type": "string",
"defaultValue": "Microsoft.Network/publicIPAddresses"
}
},
"resources": [
{
"name": "nestedDeployment",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2020-10-01",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "publicIPAddress1",
"type": "[parameters('type')]",
"apiVersion": "2019-11-01",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
}
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment