Skip to content

Instantly share code, notes, and snippets.

@bmoore-msft
Created June 13, 2017 15:32
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/bd1194cdabae90e326898f207499f536 to your computer and use it in GitHub Desktop.
Save bmoore-msft/bd1194cdabae90e326898f207499f536 to your computer and use it in GitHub Desktop.
Deploys 2 NICs in a copyLoop with different ipConfigurations
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": { },
"variables": {
"nicIPConfigurations": [
{
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets/', 'vNet', 'Subnet-1')]"
},
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', 'PIP')]"
}
},
{
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets/', 'vNet', 'Subnet-2')]"
}
}
]
},
"resources": [
{
"name": "vNet",
"type": "Microsoft.Network/virtualNetworks",
"location": "[resourceGroup().location]",
"apiVersion": "2016-03-30",
"dependsOn": [],
"tags": {
"displayName": "vNet"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": [
{
"name": "Subnet-1",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
},
{
"name": "Subnet-2",
"properties": {
"addressPrefix": "10.0.1.0/24"
}
}
]
}
},
{
"name": "[concat('nic-', copyIndex(1))]",
"type": "Microsoft.Network/networkInterfaces",
"location": "[resourceGroup().location]",
"apiVersion": "2016-03-30",
"dependsOn": [ "vNet", "PIP" ],
"copy": {
"name": "nicLoop",
"count": 2
},
"tags": {
"displayName": "nicPIP"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": "[variables('nicIPConfigurations')[copyIndex()]]"
}
]
}
},
{
"name": "PIP",
"type": "Microsoft.Network/publicIPAddresses",
"location": "[resourceGroup().location]",
"apiVersion": "2016-03-30",
"dependsOn": [],
"tags": {
"displayName": "pip"
},
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
}
],
"outputs": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment