Skip to content

Instantly share code, notes, and snippets.

@johnlokerse
Created Feb 20, 2022
Embed
What would you like to do?
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworkName": {
"type": "string"
},
"subnetName": {
"type": "string"
}
},
"resources": [
{
"condition": "[not(empty(parameters('virtualNetworkName')))]",
"name": "[parameters('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-11-01",
"location": "[resourceGroup().location]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": [
{
"name": "[if(not(empty(parameters('subnetName'))), parameters('subnetName'), 'myFalseConditionName')]",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment