Advertisement
zalupaster322

VM-B1ms-template.json

Feb 27th, 2020
2,791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 6.72 KB | None | 0 0
  1. {
  2.     "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  3.     "contentVersion": "1.0.0.0",
  4.     "parameters": {
  5.         "location": {
  6.             "type": "String"
  7.         },
  8.         "networkInterfaceName": {
  9.             "type": "String"
  10.         },
  11.         "subnetName": {
  12.             "type": "String"
  13.         },
  14.         "virtualNetworkName": {
  15.             "type": "String"
  16.         },
  17.         "addressPrefixes": {
  18.             "type": "Array"
  19.         },
  20.         "subnets": {
  21.             "type": "Array"
  22.         },
  23.         "publicIpAddressName": {
  24.             "type": "String"
  25.         },
  26.         "publicIpAddressType": {
  27.             "type": "String"
  28.         },
  29.         "publicIpAddressSku": {
  30.             "type": "String"
  31.         },
  32.         "virtualMachineName": {
  33.             "type": "String"
  34.         },
  35.         "virtualMachineRG": {
  36.             "type": "String"
  37.         },
  38.         "osDiskType": {
  39.             "type": "String"
  40.         },
  41.         "virtualMachineSize": {
  42.             "type": "String"
  43.         },
  44.         "adminUsername": {
  45.             "type": "String"
  46.         },
  47.         "adminPassword": {
  48.             "type": "SecureString"
  49.         },
  50.         "diagnosticsStorageAccountName": {
  51.             "type": "String"
  52.         },
  53.         "diagnosticsStorageAccountId": {
  54.             "type": "String"
  55.         },
  56.         "diagnosticsStorageAccountType": {
  57.             "type": "String"
  58.         },
  59.         "diagnosticsStorageAccountKind": {
  60.             "type": "String"
  61.         }
  62.     },
  63.     "variables": {
  64.         "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
  65.         "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"
  66.     },
  67.     "resources": [
  68.         {
  69.             "type": "Microsoft.Network/networkInterfaces",
  70.             "apiVersion": "2019-07-01",
  71.             "name": "[parameters('networkInterfaceName')]",
  72.             "location": "[parameters('location')]",
  73.             "dependsOn": [
  74.                 "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
  75.                 "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
  76.             ],
  77.             "properties": {
  78.                 "ipConfigurations": [
  79.                     {
  80.                         "name": "ipconfig1",
  81.                         "properties": {
  82.                             "subnet": {
  83.                                 "id": "[variables('subnetRef')]"
  84.                             },
  85.                             "privateIPAllocationMethod": "Dynamic",
  86.                             "publicIpAddress": {
  87.                                 "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
  88.                             }
  89.                         }
  90.                     }
  91.                 ]
  92.             }
  93.         },
  94.         {
  95.             "type": "Microsoft.Network/virtualNetworks",
  96.             "apiVersion": "2019-09-01",
  97.             "name": "[parameters('virtualNetworkName')]",
  98.             "location": "[parameters('location')]",
  99.             "properties": {
  100.                 "addressSpace": {
  101.                     "addressPrefixes": "[parameters('addressPrefixes')]"
  102.                 },
  103.                 "subnets": "[parameters('subnets')]"
  104.             }
  105.         },
  106.         {
  107.             "type": "Microsoft.Network/publicIpAddresses",
  108.             "apiVersion": "2019-02-01",
  109.             "name": "[parameters('publicIpAddressName')]",
  110.             "location": "[parameters('location')]",
  111.             "sku": {
  112.                 "name": "[parameters('publicIpAddressSku')]"
  113.             },
  114.             "properties": {
  115.                 "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
  116.             }
  117.         },
  118.         {
  119.             "type": "Microsoft.Compute/virtualMachines",
  120.             "apiVersion": "2019-07-01",
  121.             "name": "[parameters('virtualMachineName')]",
  122.             "location": "[parameters('location')]",
  123.             "dependsOn": [
  124.                 "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
  125.                 "[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
  126.             ],
  127.             "properties": {
  128.                 "hardwareProfile": {
  129.                     "vmSize": "[parameters('virtualMachineSize')]"
  130.                 },
  131.                 "storageProfile": {
  132.                     "osDisk": {
  133.                         "createOption": "fromImage",
  134.                         "managedDisk": {
  135.                             "storageAccountType": "[parameters('osDiskType')]"
  136.                         }
  137.                     },
  138.                     "imageReference": {
  139.                         "publisher": "MicrosoftWindowsServer",
  140.                         "offer": "WindowsServer",
  141.                         "sku": "2019-Datacenter",
  142.                         "version": "latest"
  143.                     }
  144.                 },
  145.                 "networkProfile": {
  146.                     "networkInterfaces": [
  147.                         {
  148.                             "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
  149.                         }
  150.                     ]
  151.                 },
  152.                 "osProfile": {
  153.                     "computerName": "[parameters('virtualMachineName')]",
  154.                     "adminUsername": "[parameters('adminUsername')]",
  155.                     "adminPassword": "[parameters('adminPassword')]",
  156.                     "windowsConfiguration": {
  157.                         "enableAutomaticUpdates": true,
  158.                         "provisionVmAgent": true
  159.                     }
  160.                 },
  161.                 "diagnosticsProfile": {
  162.                     "bootDiagnostics": {
  163.                         "enabled": true,
  164.                         "storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]"
  165.                     }
  166.                 }
  167.             }
  168.         },
  169.         {
  170.             "type": "Microsoft.Storage/storageAccounts",
  171.             "apiVersion": "2019-06-01",
  172.             "name": "[parameters('diagnosticsStorageAccountName')]",
  173.             "location": "[parameters('location')]",
  174.             "sku": {
  175.                 "name": "[parameters('diagnosticsStorageAccountType')]"
  176.             },
  177.             "kind": "[parameters('diagnosticsStorageAccountKind')]",
  178.             "properties": {}
  179.         }
  180.     ],
  181.     "outputs": {
  182.         "adminUsername": {
  183.             "type": "String",
  184.             "value": "[parameters('adminUsername')]"
  185.         }
  186.     }
  187. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement