Last active
November 6, 2019 16:02
-
-
Save unixfox/620e2374c6ea7d8691823c13403e8327 to your computer and use it in GitHub Desktop.
azure windows ipv6 template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "adminUsername": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the administrator of the new VM. Exclusion list: 'admin','administrator'" | |
| } | |
| }, | |
| "adminPassword": { | |
| "type": "securestring", | |
| "metadata": { | |
| "description": "The password for the administrator account of the new VM" | |
| } | |
| }, | |
| "location": { | |
| "type": "string", | |
| "defaultValue": "[resourceGroup().location]", | |
| "metadata": { | |
| "description": "Location for all resources." | |
| } | |
| } | |
| }, | |
| "variables": { | |
| "vnetv4AddressRange": "10.0.0.0/16", | |
| "vnetv6AddressRange": "ace:cab:deca::/48", | |
| "subnetv4AddressRange": "10.0.0.0/24", | |
| "subnetv6AddressRange": "ace:cab:deca:deed::/64", | |
| "subnetName": "DualStackSubnet", | |
| "newStorageAccountName": "[concat('st', uniqueString(resourceGroup().id))]", | |
| "subnet-id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', 'VNET', variables('subnetName'))]", | |
| "numberOfInstances": 1, | |
| "vmName": "DsVM", | |
| "publicipName": "RDPpublicIp", | |
| "imagePublisher": "MicrosoftWindowsServer", | |
| "imageOffer": "WindowsServer", | |
| "imageSku": "2019-Datacenter" | |
| }, | |
| "resources": [ | |
| { | |
| "apiVersion": "2019-02-01", | |
| "type": "Microsoft.Network/publicIPAddresses", | |
| "name": "[concat(variables('publicipName'), copyindex())]", | |
| "copy": { | |
| "name": "publicIpLoop", | |
| "count": "[variables('numberOfInstances')]" | |
| }, | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "publicIPAllocationMethod": "Dynamic" | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-02-01", | |
| "type": "Microsoft.Network/publicIPAddresses", | |
| "name": "lbpublicip", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "publicIPAllocationMethod": "Dynamic" | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-02-01", | |
| "type": "Microsoft.Network/publicIPAddresses", | |
| "name": "lbpublicip-v6", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "publicIPAllocationMethod": "Dynamic", | |
| "publicIPAddressVersion": "IPv6" | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-04-01", | |
| "type": "Microsoft.Storage/storageAccounts", | |
| "name": "[variables('newStorageAccountName')]", | |
| "location": "[parameters('location')]", | |
| "sku": { | |
| "name": "Standard_LRS" | |
| }, | |
| "kind": "StorageV2", | |
| "properties": { } | |
| }, | |
| { | |
| "apiVersion": "2019-02-01", | |
| "name": "loadBalancer", | |
| "type": "Microsoft.Network/loadBalancers", | |
| "location": "[parameters('location')]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Network/publicIPAddresses','lbpublicip')]", | |
| "[resourceId('Microsoft.Network/publicIPAddresses','lbpublicip-v6')]" | |
| ], | |
| "properties": { | |
| "frontendIpConfigurations": [ | |
| { | |
| "name": "LBFE", | |
| "properties": { | |
| "publicIPAddress": { | |
| "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'lbpublicip')]" | |
| } | |
| } | |
| }, | |
| { | |
| "name": "LBFE-v6", | |
| "properties": { | |
| "publicIPAddress": { | |
| "id": "[resourceId('Microsoft.Network/publicIPAddresses','lbpublicip-v6')]" | |
| } | |
| } | |
| } | |
| ], | |
| "backendAddressPools": [ | |
| { | |
| "name": "LBBAP" | |
| }, | |
| { | |
| "name": "LBBAP-v6" | |
| } | |
| ], | |
| "loadBalancingRules": [ | |
| { | |
| "properties": { | |
| "frontendIPConfiguration": { | |
| "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIpConfigurations', 'loadBalancer', 'LBFE')]" | |
| }, | |
| "backendAddressPool": { | |
| "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'loadBalancer', 'LBBAP')]" | |
| }, | |
| "protocol": "Tcp", | |
| "frontendPort": 80, | |
| "backendPort": 80, | |
| "idleTimeoutInMinutes": 15 | |
| }, | |
| "name": "lbrule" | |
| }, | |
| { | |
| "properties": { | |
| "frontendIPConfiguration": { | |
| "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIpConfigurations', 'loadBalancer', 'LBFE-v6')]" | |
| }, | |
| "backendAddressPool": { | |
| "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'loadBalancer', 'LBBAP-v6')]" | |
| }, | |
| "protocol": "Tcp", | |
| "frontendPort": 80, | |
| "backendPort": 80 | |
| }, | |
| "name": "lbrule-v6" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-02-01", | |
| "type": "Microsoft.Network/virtualNetworks", | |
| "name": "VNET", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "addressSpace": { | |
| "addressPrefixes": [ | |
| "[variables('vnetv4AddressRange')]", | |
| "[variables('vnetv6AddressRange')]" | |
| ] | |
| }, | |
| "subnets": [ | |
| { | |
| "name": "[variables('subnetName')]", | |
| "properties": { | |
| "addressPrefixes": [ | |
| "[variables('subnetv4AddressRange')]", | |
| "[variables('subnetv6AddressRange')]" | |
| ] | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-02-01", | |
| "type": "Microsoft.Network/networkSecurityGroups", | |
| "name": "dsNsg", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "securityRules": [ | |
| { | |
| "name": "allow-HTTP-in", | |
| "properties": { | |
| "description": "Allow HTTP", | |
| "protocol": "TCP", | |
| "sourcePortRange": "80", | |
| "destinationPortRange": "80", | |
| "sourceAddressPrefix": "*", | |
| "destinationAddressPrefix": "*", | |
| "access": "Allow", | |
| "priority": 1001, | |
| "direction": "Inbound" | |
| } | |
| }, | |
| { | |
| "name": "allow-all-out", | |
| "properties": { | |
| "description": "Allow out All", | |
| "protocol": "*", | |
| "sourcePortRange": "*", | |
| "destinationPortRange": "*", | |
| "sourceAddressPrefix": "*", | |
| "destinationAddressPrefix": "*", | |
| "access": "Allow", | |
| "priority": 1002, | |
| "direction": "Outbound" | |
| } | |
| }, | |
| { | |
| "name": "allow-RDP-in", | |
| "properties": { | |
| "description": "Allow RDP", | |
| "protocol": "Tcp", | |
| "sourcePortRange": "*", | |
| "destinationPortRange": "3389", | |
| "sourceAddressPrefix": "*", | |
| "destinationAddressPrefix": "*", | |
| "access": "Allow", | |
| "priority": 1003, | |
| "direction": "Inbound" | |
| } | |
| }, | |
| { | |
| "name": "allow-MyIpv6App-out", | |
| "properties": { | |
| "description": "Allow My IPv6 App", | |
| "protocol": "Tcp", | |
| "sourcePortRange": "33819-33829", | |
| "destinationPortRange": "5000-6000", | |
| "sourceAddressPrefix": "ace:cab:deca:deed::/64", | |
| "destinationAddressPrefixes": [ "cab:cab:aaaa:bbbb::/64", "cab:cab:1111:2222::/64" ], | |
| "access": "Allow", | |
| "priority": 1004, | |
| "direction": "Outbound" | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "type": "Microsoft.Network/routeTables", | |
| "name": "v6routeTable", | |
| "apiVersion": "2019-02-01", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "routes": [ | |
| { | |
| "name": "v6route", | |
| "properties": { | |
| "addressPrefix": "cab:cab::/96", | |
| "nextHopType": "VirtualAppliance", | |
| "nextHopIpAddress": "ace:cab:deca:f00d::1" | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-02-01", | |
| "type": "Microsoft.Network/networkInterfaces", | |
| "name": "[concat(variables('vmName'),copyindex())]", | |
| "copy": { | |
| "name": "netIntLoop", | |
| "count": "[variables('numberOfInstances')]" | |
| }, | |
| "location": "[parameters('location')]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Network/virtualNetworks','VNET')]", | |
| "[resourceId('Microsoft.Network/networkSecurityGroups','dsNsg')]", | |
| "[resourceId('Microsoft.Network/loadBalancers','loadBalancer')]", | |
| "publicIpLoop" | |
| ], | |
| "properties": { | |
| "networkSecurityGroup": { | |
| "id": "[resourceId('Microsoft.Network/networkSecurityGroups','dsNsg')]" | |
| }, | |
| "ipConfigurations": [ | |
| { | |
| "name": "ipconfig-v4", | |
| "properties": { | |
| "privateIPAllocationMethod": "Dynamic", | |
| "privateIPAddressVersion": "IPv4", | |
| "primary": "true", | |
| "publicIPAddress": { | |
| "id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(variables('publicipName'),copyindex()))]" | |
| }, | |
| "subnet": { | |
| "id": "[variables('subnet-id')]" | |
| }, | |
| "loadBalancerBackendAddressPools": [ | |
| { | |
| "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'loadBalancer', 'LBBAP')]" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "name": "ipconfig-v6", | |
| "properties": { | |
| "privateIPAllocationMethod": "Dynamic", | |
| "privateIPAddressVersion": "IPv6", | |
| "subnet": { | |
| "id": "[variables('subnet-id')]" | |
| }, | |
| "loadBalancerBackendAddressPools": [ | |
| { | |
| "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'loadBalancer', 'LBBAP-v6')]" | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "apiVersion": "2019-03-01", | |
| "type": "Microsoft.Compute/virtualMachines", | |
| "name": "[concat(variables('vmName'), copyindex())]", | |
| "copy": { | |
| "name": "virtualMachineLoop", | |
| "count": "[variables('numberOfInstances')]" | |
| }, | |
| "location": "[parameters('location')]", | |
| "dependsOn": [ | |
| "[resourceId('Microsoft.Storage/storageAccounts',variables('newStorageAccountName'))]", | |
| "netIntLoop" | |
| ], | |
| "properties": { | |
| "hardwareProfile": { | |
| "vmSize": "Standard_B1s" | |
| }, | |
| "osProfile": { | |
| "computerName": "[concat(variables('vmName'), copyindex())]", | |
| "adminUsername": "[parameters('adminUserName')]", | |
| "adminPassword": "[parameters('adminPassword')]" | |
| }, | |
| "storageProfile": { | |
| "imageReference": { | |
| "publisher": "[variables('imagePublisher')]", | |
| "offer": "[variables('imageOffer')]", | |
| "sku": "[variables('imageSku')]", | |
| "version": "latest" | |
| }, | |
| "osDisk": { | |
| "createOption": "FromImage" | |
| } | |
| }, | |
| "networkProfile": { | |
| "networkInterfaces": [ | |
| { | |
| "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('vmName'),copyindex()))]" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment