1 2 3 4 5 6 7 8
| { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": {"location":{"type":"string"},"networkInterfaceName":{"type":"string"},"networkIpconfigName":{"type":"string"},"networkSecurityGroupName":{"type":"string"},"networkSecurityGroupRules":{"type":"array"},"subnetName":{"type":"string"},"virtualNetworkName":{"type":"string"},"addressPrefixes":{"type":"array"},"subnets":{"type":"array"},"publicIpAddressName":{"type":"string"},"publicIpAddressType":{"type":"string"},"publicIpAddressSku":{"type":"string"},"pipDeleteOption":{"type":"string"},"virtualMachineName":{"type":"string"},"virtualMachineComputerName":{"type":"string"},"virtualMachineRG":{"type":"string"},"osDiskType":{"type":"string"},"osDiskSizeGiB":{"type":"int"},"osDiskDeleteOption":{"type":"string"},"osDiskName":{"type":"string"},"virtualMachineSize":{"type":"string"},"nicDeleteOption":{"type":"string"},"hibernationEnabled":{"type":"bool"},"adminUsername":{"type":"string"},"adminPublicKey":{"type":"secureString"},"securityType":{"type":"string"},"secureBoot":{"type":"bool"},"vTPM":{"type":"bool"}}, "variables": {"nsgId":"[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]","vnetName":"[parameters('virtualNetworkName')]","vnetId":"[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]","subnetRef":"[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"}, "resources": [{"name":"[parameters('networkInterfaceName')]","type":"Microsoft.Network/networkInterfaces","apiVersion":"2022-11-01","location":"[parameters('location')]","dependsOn":["[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]","[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]","[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"],"properties":{"ipConfigurations":[{"name":"[parameters('networkIpconfigName')]","properties":{"subnet":{"id":"[variables('subnetRef')]"},"privateIPAllocationMethod":"Dynamic","publicIpAddress":{"id":"[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]","properties":{"deleteOption":"[parameters('pipDeleteOption')]"}}}}],"networkSecurityGroup":{"id":"[variables('nsgId')]"}}},{"name":"[parameters('networkSecurityGroupName')]","type":"Microsoft.Network/networkSecurityGroups","apiVersion":"2020-05-01","location":"[parameters('location')]","properties":{"securityRules":"[parameters('networkSecurityGroupRules')]"}},{"name":"[parameters('virtualNetworkName')]","type":"Microsoft.Network/virtualNetworks","apiVersion":"2024-01-01","location":"[parameters('location')]","properties":{"addressSpace":{"addressPrefixes":"[parameters('addressPrefixes')]"},"subnets":"[parameters('subnets')]"}},{"name":"[parameters('publicIpAddressName')]","type":"Microsoft.Network/publicIpAddresses","apiVersion":"2020-08-01","location":"[parameters('location')]","properties":{"publicIpAllocationMethod":"[parameters('publicIpAddressType')]"},"sku":{"name":"[parameters('publicIpAddressSku')]"}},{"name":"[parameters('virtualMachineName')]","type":"Microsoft.Compute/virtualMachines","apiVersion":"2024-03-01","location":"[parameters('location')]","dependsOn":["[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"],"properties":{"hardwareProfile":{"vmSize":"[parameters('virtualMachineSize')]"},"storageProfile":{"osDisk":{"name":"[parameters('osDiskName')]","createOption":"fromImage","managedDisk":{"storageAccountType":"[parameters('osDiskType')]"},"diskSizeGB":"[parameters('osDiskSizeGiB')]","deleteOption":"[parameters('osDiskDeleteOption')]"},"imageReference":{"publisher":"debian","offer":"debian-12","sku":"12-gen2","version":"latest"}},"networkProfile":{"networkInterfaces":[{"id":"[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]","properties":{"deleteOption":"[parameters('nicDeleteOption')]"}}]},"securityProfile":{"securityType":"[parameters('securityType')]","uefiSettings":{"secureBootEnabled":"[parameters('secureBoot')]","vTpmEnabled":"[parameters('vTPM')]"}},"additionalCapabilities":{"hibernationEnabled":false},"osProfile":{"computerName":"[parameters('virtualMachineComputerName')]","adminUsername":"[parameters('adminUsername')]","linuxConfiguration":{"disablePasswordAuthentication":true,"ssh":{"publicKeys":[{"path":"[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]","keyData":"[parameters('adminPublicKey')]"}]}}},"diagnosticsProfile":{"bootDiagnostics":{"enabled":true}}}}], "outputs": {"adminUsername":{"type":"string","value":"[parameters('adminUsername')]"}} }
|