Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
- "contentVersion": "1.0.0.0",
- "parameters": {
- "location": {
- "type": "String"
- },
- "networkInterfaceName": {
- "type": "String"
- },
- "subnetName": {
- "type": "String"
- },
- "virtualNetworkName": {
- "type": "String"
- },
- "addressPrefixes": {
- "type": "Array"
- },
- "subnets": {
- "type": "Array"
- },
- "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"
- },
- "diagnosticsStorageAccountType": {
- "type": "String"
- },
- "diagnosticsStorageAccountKind": {
- "type": "String"
- }
- },
- "variables": {
- "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
- "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"
- },
- "resources": [
- {
- "type": "Microsoft.Network/networkInterfaces",
- "apiVersion": "2019-07-01",
- "name": "[parameters('networkInterfaceName')]",
- "location": "[parameters('location')]",
- "dependsOn": [
- "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
- "[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'))]"
- }
- }
- }
- ]
- }
- },
- {
- "type": "Microsoft.Network/virtualNetworks",
- "apiVersion": "2019-09-01",
- "name": "[parameters('virtualNetworkName')]",
- "location": "[parameters('location')]",
- "properties": {
- "addressSpace": {
- "addressPrefixes": "[parameters('addressPrefixes')]"
- },
- "subnets": "[parameters('subnets')]"
- }
- },
- {
- "type": "Microsoft.Network/publicIpAddresses",
- "apiVersion": "2019-02-01",
- "name": "[parameters('publicIpAddressName')]",
- "location": "[parameters('location')]",
- "sku": {
- "name": "[parameters('publicIpAddressSku')]"
- },
- "properties": {
- "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
- }
- },
- {
- "type": "Microsoft.Compute/virtualMachines",
- "apiVersion": "2019-07-01",
- "name": "[parameters('virtualMachineName')]",
- "location": "[parameters('location')]",
- "dependsOn": [
- "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
- "[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
- ],
- "properties": {
- "hardwareProfile": {
- "vmSize": "[parameters('virtualMachineSize')]"
- },
- "storageProfile": {
- "osDisk": {
- "createOption": "fromImage",
- "managedDisk": {
- "storageAccountType": "[parameters('osDiskType')]"
- }
- },
- "imageReference": {
- "publisher": "MicrosoftWindowsServer",
- "offer": "WindowsServer",
- "sku": "2019-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/')]"
- }
- }
- }
- },
- {
- "type": "Microsoft.Storage/storageAccounts",
- "apiVersion": "2019-06-01",
- "name": "[parameters('diagnosticsStorageAccountName')]",
- "location": "[parameters('location')]",
- "sku": {
- "name": "[parameters('diagnosticsStorageAccountType')]"
- },
- "kind": "[parameters('diagnosticsStorageAccountKind')]",
- "properties": {}
- }
- ],
- "outputs": {
- "adminUsername": {
- "type": "String",
- "value": "[parameters('adminUsername')]"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement