|
{ |
|
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
|
"contentVersion": "1.0.0.0", |
|
"metadata": { |
|
"_generator": { |
|
"name": "bicep", |
|
"version": "0.4.63.48766", |
|
"templateHash": "14576519551725798596" |
|
} |
|
}, |
|
"parameters": { |
|
"vmUsername": { |
|
"type": "string" |
|
}, |
|
"vmPassword": { |
|
"type": "string" |
|
}, |
|
"namePrefix": { |
|
"type": "string", |
|
"defaultValue": "not set" |
|
} |
|
}, |
|
"functions": [], |
|
"resources": [ |
|
{ |
|
"type": "Microsoft.Network/virtualNetworks", |
|
"apiVersion": "2020-11-01", |
|
"name": "[format('{0}-vnet', parameters('namePrefix'))]", |
|
"location": "[resourceGroup().location]", |
|
"properties": { |
|
"addressSpace": { |
|
"addressPrefixes": [ |
|
"10.99.0.0/25" |
|
] |
|
}, |
|
"subnets": [ |
|
{ |
|
"name": "[format('{0}-subnet', parameters('namePrefix'))]", |
|
"properties": { |
|
"addressPrefix": "10.99.0.0/25", |
|
"delegations": [], |
|
"privateEndpointNetworkPolicies": "Enabled", |
|
"privateLinkServiceNetworkPolicies": "Enabled" |
|
} |
|
} |
|
], |
|
"virtualNetworkPeerings": [], |
|
"enableDdosProtection": false |
|
} |
|
}, |
|
{ |
|
"type": "Microsoft.Network/networkInterfaces", |
|
"apiVersion": "2020-08-01", |
|
"name": "[format('{0}-nic', parameters('namePrefix'))]", |
|
"location": "[resourceGroup().location]", |
|
"properties": { |
|
"ipConfigurations": [ |
|
{ |
|
"name": "ipconfig1", |
|
"properties": { |
|
"privateIPAddress": "10.99.0.4", |
|
"privateIPAllocationMethod": "Dynamic", |
|
"subnet": { |
|
"id": "[format('{0}/subnets/{1}-subnet', resourceId('Microsoft.Network/virtualNetworks', format('{0}-vnet', parameters('namePrefix'))), parameters('namePrefix'))]" |
|
}, |
|
"primary": true, |
|
"privateIPAddressVersion": "IPv4" |
|
} |
|
} |
|
], |
|
"dnsSettings": { |
|
"dnsServers": [] |
|
}, |
|
"enableAcceleratedNetworking": false, |
|
"enableIPForwarding": false |
|
}, |
|
"dependsOn": [ |
|
"[resourceId('Microsoft.Network/virtualNetworks', format('{0}-vnet', parameters('namePrefix')))]" |
|
] |
|
}, |
|
{ |
|
"type": "Microsoft.Compute/virtualMachines", |
|
"apiVersion": "2020-12-01", |
|
"name": "[format('{0}-vm', parameters('namePrefix'))]", |
|
"location": "[resourceGroup().location]", |
|
"properties": { |
|
"hardwareProfile": { |
|
"vmSize": "Standard_B1ms" |
|
}, |
|
"storageProfile": { |
|
"osDisk": { |
|
"createOption": "FromImage", |
|
"managedDisk": { |
|
"storageAccountType": "StandardSSD_LRS" |
|
} |
|
}, |
|
"imageReference": { |
|
"publisher": "Canonical", |
|
"offer": "UbuntuServer", |
|
"sku": "18.04-LTS", |
|
"version": "latest" |
|
} |
|
}, |
|
"osProfile": { |
|
"computerName": "[format('{0}-cn', parameters('namePrefix'))]", |
|
"adminUsername": "[parameters('vmUsername')]", |
|
"adminPassword": "[parameters('vmPassword')]" |
|
}, |
|
"networkProfile": { |
|
"networkInterfaces": [ |
|
{ |
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', format('{0}-nic', parameters('namePrefix')))]" |
|
} |
|
] |
|
} |
|
}, |
|
"dependsOn": [ |
|
"[resourceId('Microsoft.Network/networkInterfaces', format('{0}-nic', parameters('namePrefix')))]" |
|
] |
|
} |
|
] |
|
} |