az disk
Manage Azure Managed Disks.
Commands
az disk create | Create a managed disk. |
az disk delete | Delete a managed disk. |
az disk grant-access | Grant a resource read access to a managed disk. |
az disk list | List managed disks. |
az disk revoke-access | Revoke a resource's read access to a managed disk. |
az disk show | Gets information about a disk. |
az disk update | Update a managed disk. |
az disk wait | Place the CLI in a waiting state until a condition of a managed disk is met. |
az disk create
Create a managed disk.
az disk create --name
--resource-group
[--location]
[--no-wait]
[--size-gb]
[--sku {Premium_LRS, Standard_LRS}]
[--source]
[--source-storage-account-id]
[--tags]
[--zone {1, 2, 3}]
Examples
Create a managed disk by importing from a blob uri.
az disk create -g MyResourceGroup -n MyDisk --source https://vhd1234.blob.core.windows.net/vhds/osdisk1234.vhd
Create an empty managed disk.
az disk create -g MyResourceGroup -n MyDisk --size-gb 10
Create a managed disk by copying an existing disk or snapshot.
az disk create -g MyResourceGroup -n MyDisk2 --source MyDisk
Create a disk in an availability zone in the region of "East US 2"
az disk create -n MyDisk -g MyResourceGroup --size-gb 10 --location eastus2 --zone 1
Required Parameters
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Location. You can configure the default location using az configure --defaults location=<location>
.
Do not wait for the long-running operation to finish.
Size in GB.
Underlying storage SKU.
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 in 'key[=value]' format. Use "" to clear existing tags.
Availability zone into which to provision the resource.
az disk delete
Delete a managed disk.
az disk delete --name
--resource-group
[--no-wait]
[--yes]
Required Parameters
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running operation to finish.
Do not prompt for confirmation.
az disk grant-access
Grant a resource read access to a managed disk.
az disk grant-access --duration-in-seconds
--name
--resource-group
Required Parameters
Time duration in seconds until the SAS access expires.
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
az disk list
List managed disks.
az disk list [--resource-group]
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
az disk revoke-access
Revoke a resource's read access to a managed disk.
az disk revoke-access --name
--resource-group
Required Parameters
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
az disk show
Gets information about a disk.
az disk show --name
--resource-group
Required Parameters
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
az disk update
Update a managed disk.
az disk update --name
--resource-group
[--add]
[--no-wait]
[--remove]
[--set]
[--size-gb]
[--sku {Premium_LRS, Standard_LRS}]
Required Parameters
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
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>.
Do not wait for the long-running operation to finish.
Remove a property or an element from a list. Example: --remove property.list
Update an object by specifying a property path and value to set. Example: --set property1.property2=
Size in GB.
Underlying storage SKU.
az disk wait
Place the CLI in a waiting state until a condition of a managed disk is met.
az disk wait --name
--resource-group
[--created]
[--custom]
[--deleted]
[--exists]
[--interval]
[--timeout]
[--updated]
Required Parameters
The name of the managed disk.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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.
Polling interval in seconds.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.