az snapshot

Manage point-in-time copies of managed disks, native blobs, or other snapshots.

Commands

az snapshot create Create a snapshot.
az snapshot delete Deletes a snapshot.
az snapshot grant-access Grant read access to a snapshot.
az snapshot list List snapshots.
az snapshot revoke-access Revoke read access to a snapshot.
az snapshot show Gets information about a snapshot.
az snapshot update Update a snapshot.

az snapshot create

Create a snapshot.

az snapshot create --name
--resource-group
[--location]
[--size-gb]
[--sku {Premium_LRS, Standard_LRS}]
[--source]
[--source-storage-account-id]
[--tags]

Examples

Create a snapshot by importing from a blob uri.

az snapshot create -g MyResourceGroup -n MySnapshot --source https://vhd1234.blob.core.windows.net/vhds/osdisk1234.vhd

Create an empty snapshot.

az snapshot create -g MyResourceGroup -n MySnapshot --size-gb 10

Create a snapshot by copying an existing disk in the same resource group.

az snapshot create -g MyResourceGroup -n MySnapshot2 --source MyDisk

Required Parameters

--name -n
The name of the snapshot.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

Optional Parameters

--location -l
Location. You can configure the default location using `az configure --defaults location=<location>`.
--size-gb -z
Size in GB.
--sku
Underlying storage sku.
accepted values: Premium_LRS, Standard_LRS
default value: Standard_LRS
--source
Source to create the disk/snapshot from, including unmanaged blob uri, managed disk id or name, or snapshot id or name.
--source-storage-account-id
Used when source blob is in a different subscription.
--tags
Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

az snapshot delete

Deletes a snapshot.

az snapshot delete --name
--resource-group

Required Parameters

--name -n
The name of the snapshot.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

az snapshot grant-access

Grant read access to a snapshot.

az snapshot grant-access --duration-in-seconds
--name
--resource-group

Required Parameters

--duration-in-seconds
Time duration in seconds until the SAS access expires.
--name -n
The name of the snapshot.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

az snapshot list

List snapshots.

az snapshot 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 snapshot revoke-access

Revoke read access to a snapshot.

az snapshot revoke-access --name
--resource-group

Required Parameters

--name -n
The name of the snapshot.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

az snapshot show

Gets information about a snapshot.

az snapshot show --name
--resource-group

Required Parameters

--name -n
The name of the snapshot.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

az snapshot update

Update a snapshot.

az snapshot update --name
--resource-group
[--add]
[--remove]
[--set]
[--sku {Premium_LRS, Standard_LRS}]

Required Parameters

--name -n
The name of the snapshot.
--resource-group -g
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

Optional Parameters

--add
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty .
--remove
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
--set
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
--sku
Underlying storage sku.
accepted values: Premium_LRS, Standard_LRS