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 wait |
Place the CLI in a waiting state until a condition of a snapshot is met. |
az snapshot create
Create a snapshot.
az snapshot create --name
--resource-group
[--accelerated-network {false, true}]
[--architecture {Arm64, x64}]
[--copy-start {false, true}]
[--disk-access]
[--disk-encryption-set]
[--edge-zone]
[--encryption-type {EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey}]
[--for-upload {false, true}]
[--hyper-v-generation {V1, V2}]
[--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
The name of the snapshot.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Customers can set on Managed Disks or Snapshots to enable the accelerated networking if the OS disk image support.
CPU architecture.
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.
Name or ID of the disk access resource for using private endpoints on disks.
Name or ID of disk encryption set that is used to encrypt the disk.
The name of edge zone.
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.
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.
The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed.
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.
Policy for accessing the disk via network.
Do not wait for the long-running operation to finish.
Customers can set on Managed Disks or Snapshots to control the export policy on the disk.
Size in GB. Max size: 4095 GB (certain preview disks can be larger).
Source to create the disk/snapshot from, including unmanaged blob uri, managed disk id or name, or snapshot id or name.
Used when source blob is in a different subscription.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot delete
Deletes a snapshot.
az snapshot delete [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
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.
The name of the snapshot.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot grant-access
Grant read access to a snapshot.
az snapshot grant-access --duration-in-seconds
[--access-level {Read, Write}]
[--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Grant read access to a snapshot. (autogenerated)
az snapshot grant-access --duration-in-seconds 3600 --name MySnapshot --resource-group MyResourceGroup
Required Parameters
Time duration in seconds until the SAS access expires.
Optional Parameters
Access level.
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.
The name of the snapshot.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot list
List snapshots.
az snapshot list [--resource-group]
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot revoke-access
Revoke read access to a snapshot.
az snapshot revoke-access [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Revoke read access to a snapshot. (autogenerated)
az snapshot revoke-access --name MySnapshot --resource-group MyResourceGroup
Optional Parameters
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.
The name of the snapshot.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot show
Gets information about a snapshot.
az snapshot show [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
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.
The name of the snapshot.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot update
Update a snapshot.
az snapshot update [--accelerated-network {false, true}]
[--add]
[--architecture {Arm64, x64}]
[--disk-access]
[--disk-encryption-set]
[--encryption-type {EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys, EncryptionAtRestWithPlatformKey}]
[--force-string]
[--ids]
[--name]
[--network-access-policy {AllowAll, AllowPrivate, DenyAll}]
[--no-wait]
[--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. (autogenerated)
az snapshot update --name MySnapshot --resource-group MyResourceGroup --subscription MySubscription
Optional Parameters
Customers can set on Managed Disks or Snapshots to enable the accelerated networking if the OS disk image support.
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>.
CPU architecture.
Name or ID of the disk access resource for using private endpoints on disks.
Name or ID of disk encryption set that is used to encrypt the disk.
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.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
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.
The name of the snapshot.
Policy for accessing the disk via network.
Do not wait for the long-running operation to finish.
Customers can set on Managed Disks or Snapshots to control the export policy on the disk.
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az snapshot wait
Place the CLI in a waiting state until a condition of a snapshot is met.
az snapshot wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
Examples
Place the CLI in a waiting state until a condition of a snapshot is met. (autogenerated)
az snapshot wait --exists --name MySnapshot --resource-group MyResourceGroup
Place the CLI in a waiting state until a condition of a snapshot is met. (autogenerated)
az snapshot wait --created --name MySnapshot --resource-group MyResourceGroup
Optional Parameters
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
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.
Polling interval in seconds.
The name of the snapshot.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
Submit and view feedback for