Skip to main content

Virtual Machine

Provides a Virtual Machine:

const { MACHINE_ADMIN_USERNAME, MACHINE_ADMIN_PASSWORD } = process.env;
const vm = await provider.makeVirtualMachine({
name: `vm`,
dependencies: {
resourceGroup,
networkInterface,
},
properties: () => ({
properties: {
hardwareProfile: {
vmSize: "Standard_A1_v2",
},
storageProfile: {
imageReference: {
offer: "UbuntuServer",
publisher: "Canonical",
sku: "18.04-LTS",
version: "latest",
},
},
osProfile: {
adminUsername: MACHINE_ADMIN_USERNAME,
computerName: "myVM",
adminPassword: MACHINE_ADMIN_PASSWORD,
},
},
}),
});

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#