Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmoore-msft/09c395015e9486c75ddb2f45dc5028b0 to your computer and use it in GitHub Desktop.
Save bmoore-msft/09c395015e9486c75ddb2f45dc5028b0 to your computer and use it in GitHub Desktop.
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