Created
October 20, 2018 18:01
-
-
Save KaiWalter/8baa4ac5e1ee0aa3d9e2a2c750706c09 to your computer and use it in GitHub Desktop.
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": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "location": { | |
| "type": "string" | |
| }, | |
| "networkInterfaceName": { | |
| "type": "string" | |
| }, | |
| "networkSecurityGroupName": { | |
| "type": "string" | |
| }, | |
| "networkSecurityGroupRules": { | |
| "type": "array" | |
| }, | |
| "virtualNetworkId": { | |
| "type": "string" | |
| }, | |
| "subnetName": { | |
| "type": "string" | |
| }, | |
| "publicIpAddressName": { | |
| "type": "string" | |
| }, | |
| "publicIpAddressType": { | |
| "type": "string" | |
| }, | |
| "publicIpAddressSku": { | |
| "type": "string" | |
| }, | |
| "virtualMachineName": { | |
| "type": "string" | |
| }, | |
| "virtualMachineRG": { | |
| "type": "string" | |
| }, | |
| "osDiskType": { | |
| "type": "string" | |
| }, | |
| "virtualMachineSize": { | |
| "type": "string" | |
| }, | |
| "adminUsername": { | |
| "type": "string" | |
| }, | |
| "adminPassword": { | |
| "type": "secureString" | |
| }, | |
| "diagnosticsStorageAccountName": { | |
| "type": "string" | |
| }, | |
| "diagnosticsStorageAccountId": { | |
| "type": "string" | |
| } | |
| }, | |
| "variables": { | |
| "nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]", | |
| "vnetId": "[parameters('virtualNetworkId')]", | |
| "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]" | |
| }, | |
| "resources": [ | |
| { | |
| "name": "[parameters('networkInterfaceName')]", | |
| "type": "Microsoft.Network/networkInterfaces", | |
| "apiVersion": "2018-04-01", | |
| "location": "[parameters('location')]", | |
| "dependsOn": [ | |
| "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]", | |
| "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]" | |
| ], | |
| "properties": { | |
| "ipConfigurations": [ | |
| { | |
| "name": "ipconfig1", | |
| "properties": { | |
| "subnet": { | |
| "id": "[variables('subnetRef')]" | |
| }, | |
| "privateIPAllocationMethod": "Dynamic", | |
| "publicIpAddress": { | |
| "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]" | |
| } | |
| } | |
| } | |
| ], | |
| "networkSecurityGroup": { | |
| "id": "[variables('nsgId')]" | |
| } | |
| }, | |
| "tags": {} | |
| }, | |
| { | |
| "name": "[parameters('networkSecurityGroupName')]", | |
| "type": "Microsoft.Network/networkSecurityGroups", | |
| "apiVersion": "2018-08-01", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "securityRules": "[parameters('networkSecurityGroupRules')]" | |
| }, | |
| "tags": {} | |
| }, | |
| { | |
| "name": "[parameters('publicIpAddressName')]", | |
| "type": "Microsoft.Network/publicIpAddresses", | |
| "apiVersion": "2018-08-01", | |
| "location": "[parameters('location')]", | |
| "properties": { | |
| "publicIpAllocationMethod": "[parameters('publicIpAddressType')]" | |
| }, | |
| "sku": { | |
| "name": "[parameters('publicIpAddressSku')]" | |
| }, | |
| "tags": {} | |
| }, | |
| { | |
| "name": "[parameters('virtualMachineName')]", | |
| "type": "Microsoft.Compute/virtualMachines", | |
| "apiVersion": "2018-06-01", | |
| "location": "[parameters('location')]", | |
| "dependsOn": [ | |
| "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]" | |
| ], | |
| "properties": { | |
| "hardwareProfile": { | |
| "vmSize": "[parameters('virtualMachineSize')]" | |
| }, | |
| "storageProfile": { | |
| "osDisk": { | |
| "createOption": "fromImage", | |
| "managedDisk": { | |
| "storageAccountType": "[parameters('osDiskType')]" | |
| } | |
| }, | |
| "imageReference": { | |
| "publisher": "MicrosoftWindowsServer", | |
| "offer": "WindowsServer", | |
| "sku": "2016-Datacenter", | |
| "version": "latest" | |
| } | |
| }, | |
| "networkProfile": { | |
| "networkInterfaces": [ | |
| { | |
| "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]" | |
| } | |
| ] | |
| }, | |
| "osProfile": { | |
| "computerName": "[parameters('virtualMachineName')]", | |
| "adminUsername": "[parameters('adminUsername')]", | |
| "adminPassword": "[parameters('adminPassword')]", | |
| "windowsConfiguration": { | |
| "enableAutomaticUpdates": true, | |
| "provisionVmAgent": true | |
| } | |
| }, | |
| "diagnosticsProfile": { | |
| "bootDiagnostics": { | |
| "enabled": true, | |
| "storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]" | |
| } | |
| } | |
| }, | |
| "tags": {} | |
| } | |
| ], | |
| "outputs": { | |
| "adminUsername": { | |
| "type": "string", | |
| "value": "[parameters('adminUsername')]" | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment