Skip to main content

Virtual Machine

Provides a Virtual Machine:

provider.compute.makeVirtualMachine({
name: "vm",
properties: ({ config }) => ({
properties: {
hardwareProfile: {
vmSize: "Standard_A1_v2",
},
storageProfile: {
imageReference: {
publisher: "Canonical",
offer: "UbuntuServer",
sku: "18.04-LTS",
version: "latest",
},
},
osProfile: {
computerName: "myVM",
adminUsername: "ops",
linuxConfiguration: {
disablePasswordAuthentication: false,
provisionVMAgent: true,
},
allowExtensionOperations: true,
adminPassword: process.env.VM_ADMIN_PASSWORD,
},
},
}),
dependencies: ({ resources }) => ({
resourceGroup: resources.resourceManagement.ResourceGroup["resource-group"],
networkInterface:
resources.virtualNetworks.NetworkInterface["network-interface"],
}),
});

Retrieve the list of all possible virtual machine on a given location:

az vm list-sizes --output table --location uksouth

Regarding the imageReference, execute this command and select the desired image:

az vm image list --output table

Examples#

Properties#

Dependencies#