az image

Manage custom virtual machine images.

Commands

az image create Create a custom Virtual Machine Image from managed disks or snapshots.
az image delete Deletes an Image.
az image list List custom VM images.
az image show Gets an image.

az image create

Create a custom Virtual Machine Image from managed disks or snapshots.

az image create --name
--resource-group
--source
[--data-disk-sources]
[--location]
[--os-type {Linux, Windows}]
[--tags]

Examples

Create an image from an existing disk.

az image create -g MyResourceGroup -n image1 --os-type Linux     --source /subscriptions/db5eb68e-73e2-4fa8-b18a-0123456789999/resourceGroups/rg1/providers/Microsoft.Compute/snapshots/s1     --data-snapshot /subscriptions/db5eb68e-73e2-4fa8-b18a-0123456789999/resourceGroups/rg/providers/Microsoft.Compute/snapshots/s2

Create an image by capturing an existing generalized virtual machine in the same resource group.

az image create -g MyResourceGroup -n image1 --source MyVm1

Required Parameters

--name -n

New image name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--source

OS disk source from the same region, including a virtual machine id or name, os disk blob uri, managed os disk id or name, or os snapshot id or name.

Optional Parameters

--data-disk-sources

Space separated 1 or more data disk sources, including unmanaged blob uri, managed disk id or name, or snapshot id or name.

--location -l

Location. You can configure the default location using az configure --defaults location=<location>.

--os-type
accepted values: Linux, Windows
--tags

Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

az image delete

Deletes an Image.

az image delete --name
--resource-group

Required Parameters

--name -n

The name of the image.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az image list

List custom VM images.

az image list [--resource-group]

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az image show

Gets an image.

az image show --name
--resource-group
[--expand]

Required Parameters

--name -n

The name of the image.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--expand

The expand expression to apply on the operation.