-
-
Save johnlokerse/50f87d17ff7b9da8ff9fdbab75934ad1 to your computer and use it in GitHub Desktop.
Blog Generate Bicep parameters
This file contains 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
@description('The name of the virtual machine.') | |
param parVmName string | |
@allowed([ | |
'westeurope' | |
'northeurope' | |
]) | |
param parLocation string | |
param parComputerName string | |
param parAdminUserName string | |
@secure() | |
param parAdminPassword string | |
param parDiskSizeInGb int | |
resource resWindowsVM 'Microsoft.Compute/virtualMachines@2020-12-01' = { | |
name: parVmName | |
location: parLocation | |
properties: { | |
hardwareProfile: { | |
vmSize: 'Standard_A2_v2' | |
} | |
osProfile: { | |
computerName: parComputerName | |
adminUsername: parAdminUserName | |
adminPassword: parAdminPassword | |
} | |
storageProfile: { | |
imageReference: { | |
publisher: 'MicrosoftWindowsServer' | |
offer: 'WindowsServer' | |
sku: '2012-R2-Datacenter' | |
version: 'latest' | |
} | |
osDisk: { | |
name: 'osdisk-${parVmName}' | |
caching: 'ReadWrite' | |
createOption: 'FromImage' | |
diskSizeGB: parDiskSizeInGb | |
} | |
} | |
networkProfile: { | |
networkInterfaces: [ | |
{ | |
id: resNic.id | |
} | |
] | |
} | |
diagnosticsProfile: { | |
bootDiagnostics: { | |
enabled: true | |
storageUri: 'storageUri' | |
} | |
} | |
} | |
} | |
resource resNic 'Microsoft.Network/networkInterfaces@2020-11-01' = { | |
name: '${parVmName}-nic' | |
location: parLocation | |
properties: { | |
ipConfigurations: [ | |
{ | |
name: '${parVmName}-ipconfig' | |
properties: { | |
privateIPAllocationMethod: 'Dynamic' | |
subnet: { | |
id: resSubnetRef.id | |
} | |
} | |
} | |
] | |
} | |
} | |
resource resSubnetRef 'Microsoft.Network/virtualNetworks/subnets@2022-01-01' = { | |
name: 'MyVnet/MySubnet' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment