I'm trying to create resources on Azure Cloud using Bicep but im not sure where to find required properties
I'm using this link https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachines?pivots=deployment-language-bicep to look for VM resources properties but it doesn't say which one are required and which one are optional like Terraform registry
Unlike terraform, there is no specific document for the required and optional parameters for creating a virtual machine using bicep.
One way to know is go through the terraform document and find out the required parameters and provide same in the Bicep resource properties.
Or check below few required properties for VM creation using bicep:
name
,location
,type
,apiVersion
,properties.storageProfile.imageReference.publisher,offer, sku
,properties.osProfile.computerName
,properties.osProfile.adminUsername
,properties.osProfile.adminPassword
,properties.hardwareProfile.vmSize
,properties.networkProfile.networkInterfaces.id
And as suggested by @Peter Bons, look into property values for the above required properties.
I would recommend you look into below sample templates as all the required properties are provided here.
References:
After checking above, below is the code which I tried in my environment using mandatory properties for VM creation.
Deployment succeeded: