Share via


az snapshot

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

Commands

Name Description Type Status
az snapshot create

Create a snapshot.

Core GA
az snapshot delete

Delete a snapshot.

Core GA
az snapshot grant-access

Grant read access to a snapshot.

Core GA
az snapshot list

List snapshots under a resource group.

Core GA
az snapshot revoke-access

Revoke access to a snapshot.

Core GA
az snapshot show

Get information about a snapshot.

Core GA
az snapshot update

Update a snapshot.

Core GA
az snapshot wait

Place the CLI in a waiting state until a condition is met.

Core GA

az snapshot create

Create a snapshot.

az snapshot create --name
                   --resource-group
                   [--accelerated-network {false, true}]
                   [--architecture {Arm64, x64}]
                   [--bandwidth-copy-speed {Enhanced, None}]
                   [--copy-start {false, true}]
                   [--disk-access]
                   [--disk-encryption-set]
                   [--edge-zone]
                   [--elastic-san-id --elastic-san-resource-id]
                   [--encryption-type {EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey}]
                   [--for-upload {false, true}]
                   [--hyper-v-generation {V1, V2}]
                   [--ia-duration --instant-access-duration-minutes]
                   [--incremental {false, true}]
                   [--___location]
                   [--network-access-policy {AllowAll, AllowPrivate, DenyAll}]
                   [--no-wait]
                   [--public-network-access {Disabled, Enabled}]
                   [--size-gb]
                   [--sku {Premium_LRS, Standard_LRS, Standard_ZRS}]
                   [--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

Create a snapshot from an existing disk in another resource group.

az snapshot create -g MyResourceGroup -n MySnapshot2 --source "/subscriptions/00000/resourceGroups/AnotherResourceGroup/providers/Microsoft.Compute/disks/MyDisk"

Create a snapshot and associate it with a disk access resource.

az snapshot create -g MyResourceGroup -n MySnapshot --size-gb 10 --network-access-policy AllowPrivate --disk-access MyDiskAccessID

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-network
Preview

Customers can set on Managed Disks or Snapshots to enable the accelerated networking if the OS disk image support.

Property Value
Accepted values: false, true
--architecture

CPU architecture.

Property Value
Accepted values: Arm64, x64
--bandwidth-copy-speed

If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed.

Property Value
Accepted values: Enhanced, None
--copy-start

Create snapshot by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source.

Property Value
Accepted values: false, true
--disk-access

Name or ID of the disk access resource for using private endpoints on disks.

--disk-encryption-set

Name or ID of disk encryption set that is used to encrypt the disk.

--edge-zone

The name of edge zone.

--elastic-san-id --elastic-san-resource-id

This is the ARM id of the source elastic san volume snapshot.

--encryption-type

Encryption type. EncryptionAtRestWithPlatformKey: Disk is encrypted with XStore managed key at rest. It is the default encryption type. EncryptionAtRestWithCustomerKey: Disk is encrypted with Customer managed key at rest.

Property Value
Accepted values: EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey
--for-upload

Create the snapshot for uploading blobs later on through storage commands. Run "az snapshot grant-access --access-level Write" to retrieve the snapshot's SAS token.

Property Value
Accepted values: false, true
--hyper-v-generation

The hypervisor generation of the Virtual Machine. Applicable to OS disks only.

Property Value
Accepted values: V1, V2
--ia-duration --instant-access-duration-minutes

For snapshots created from Premium SSD v2 or Ultra disk, this property determines the time in minutes the snapshot is retained for instant access to enable faster restore. The disk sku should be UltraSSD_LRS or PremiumV2_LRS.

--incremental

Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed.

Property Value
Accepted values: false, true
--___location -l

Location. Values from: az account list-locations. You can configure the default ___location using az configure --defaults ___location=<___location>. If ___location is not specified and no default ___location specified, ___location will be automatically set as same as the resource group.

--network-access-policy

Policy for accessing the disk via network.

Property Value
Accepted values: AllowAll, AllowPrivate, DenyAll
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--public-network-access
Preview

Customers can set on Managed Disks or Snapshots to control the export policy on the disk.

Property Value
Accepted values: Disabled, Enabled
--size-gb -z

Size in GB. Max size: 4095 GB (certain preview disks can be larger).

--sku
Property Value
Default value: Standard_LRS
Accepted values: Premium_LRS, Standard_LRS, Standard_ZRS
--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: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot delete

Delete a snapshot.

az snapshot delete [--ids]
                   [--name --snapshot-name]
                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                   [--resource-group]
                   [--subscription]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --snapshot-name -n

The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot grant-access

Grant read access to a snapshot.

az snapshot grant-access --duration-in-seconds
                         [--access --access-level {Read, Write}]
                         [--file-format {VHD, VHDX}]
                         [--ids]
                         [--name --snapshot-name]
                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                         [--resource-group]
                         [--subscription]

Examples

Grant read access to a snapshot.

az snapshot grant-access --duration-in-seconds 3600 --name MySnapshot --resource-group MyResourceGroup

Grant read access to a snapshot with specifying the file format.

az snapshot grant-access --duration-in-seconds 3600 --name MySnapshot --resource-group MyResourceGroup --file-format VHDX

Required Parameters

--duration-in-seconds

Time duration in seconds until the SAS access expires.

Property Value
Parameter group: GrantAccessData Arguments

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--access --access-level

Access level.

Property Value
Parameter group: GrantAccessData Arguments
Default value: Read
Accepted values: Read, Write
--file-format

Used to specify the file format when making request for SAS on a VHDX file format snapshot.

Property Value
Parameter group: GrantAccessData Arguments
Accepted values: VHD, VHDX
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --snapshot-name -n

The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot list

List snapshots under a resource group.

az snapshot list [--max-items]
                 [--next-token]
                 [--resource-group]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

Property Value
Parameter group: Pagination Arguments
--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Property Value
Parameter group: Pagination Arguments
--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot revoke-access

Revoke access to a snapshot.

az snapshot revoke-access [--ids]
                          [--name --snapshot-name]
                          [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                          [--resource-group]
                          [--subscription]

Examples

Revoke read access to a snapshot.

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --snapshot-name -n

The name of the snapshot.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot show

Get information about a snapshot.

az snapshot show [--ids]
                 [--name --snapshot-name]
                 [--resource-group]
                 [--subscription]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --snapshot-name -n

The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot update

Update a snapshot.

az snapshot update [--accelerated-network {0, 1, f, false, n, no, t, true, y, yes}]
                   [--add]
                   [--architecture {Arm64, x64}]
                   [--disk-access]
                   [--disk-encryption-set]
                   [--encryption-type {EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey}]
                   [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                   [--ids]
                   [--name --snapshot-name]
                   [--network-access-policy {AllowAll, AllowPrivate, DenyAll}]
                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                   [--public-network-access {Disabled, Enabled}]
                   [--remove]
                   [--resource-group]
                   [--set]
                   [--sku {Premium_LRS, Standard_LRS, Standard_ZRS}]
                   [--subscription]

Examples

Update a snapshot and associate it with a disk access resource.

az snapshot update --name MySnapshot --resource-group MyResourceGroup --network-access-policy AllowPrivate --disk-access MyDiskAccessID

Update a snapshot.

az snapshot update --name MySnapshot --resource-group MyResourceGroup --subscription MySubscription

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-network
Preview

Customers can set on Managed Disks or Snapshots to enable the accelerated networking if the OS disk image support.

Property Value
Parameter group: SupportedCapabilities Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Property Value
Parameter group: Generic Update Arguments
--architecture

CPU architecture.

Property Value
Parameter group: SupportedCapabilities Arguments
Accepted values: Arm64, x64
--disk-access

Name or ID of the disk access resource for using private endpoints on disks.

--disk-encryption-set

Name or ID of disk encryption set that is used to encrypt the disk.

--encryption-type

Encryption type.

Property Value
Parameter group: Encryption Arguments
Accepted values: EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Property Value
Parameter group: Generic Update Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name --snapshot-name -n

The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.

Property Value
Parameter group: Resource Id Arguments
--network-access-policy

Policy for accessing the disk via network.

Property Value
Parameter group: Properties Arguments
Accepted values: AllowAll, AllowPrivate, DenyAll
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--public-network-access
Preview

Policy for controlling export on the disk.

Property Value
Parameter group: Properties Arguments
Accepted values: Disabled, Enabled
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
--sku

The sku name.

Property Value
Accepted values: Premium_LRS, Standard_LRS, Standard_ZRS
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az snapshot wait

Place the CLI in a waiting state until a condition is met.

az snapshot wait [--created]
                 [--custom]
                 [--deleted]
                 [--exists]
                 [--ids]
                 [--interval]
                 [--name --snapshot-name]
                 [--resource-group]
                 [--subscription]
                 [--timeout]
                 [--updated]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

Property Value
Parameter group: Wait Condition Arguments
--deleted

Wait until deleted.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--exists

Wait until the resource exists.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--interval

Polling interval in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 30
--name --snapshot-name -n

The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--timeout

Maximum wait in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False