az-disk
Manage Azure managed disks
TLDR
Create a managed disk
List managed disks in a resource group
Delete a managed disk
Grant read or write access to a managed disk (for export)
Update disk size
SYNOPSIS
az disk <SUBCOMMAND> [OPTIONS]
Common subcommands include:
az disk create: Create a managed disk.
az disk delete: Delete a managed disk.
az disk list: List managed disks.
az disk show: Get the details of a managed disk.
az disk update: Update a managed disk.
az disk grant-access: Grant access to a managed disk or a snapshot for specific operations (e.g., data copy).
az disk revoke-access: Revoke access to a managed disk or a snapshot.
PARAMETERS
--name -n
Name of the disk. Used with create, delete, show, update.
--resource-group -g
Name of the resource group the disk belongs to or will be created in.
--location -l
Azure region where the disk will be created (e.g., eastus, westus2).
--size-gb
Size of the disk in GiB (Gigabytes).
--sku
Disk SKU or performance tier (e.g., Standard_LRS, Premium_LRS, UltraSSD_LRS).
--os-type
Type of OS the disk is intended for (Linux or Windows).
--source
Resource ID of a snapshot, image, or another disk to create this disk from.
--encryption-type
Type of encryption to apply to the disk (e.g., EncryptionAtRestWithPlatformKey, EncryptionAtRestWithCustomerKey).
--tags
Space-separated tags in 'key=value' format to apply to the disk.
--output -o
Output format of the command (e.g., json, table, tsv, yaml).
--query
JMESPath query string to filter or transform the command output.
DESCRIPTION
The command az-disk is not a standard Linux command found in typical distributions. It is highly probable that the intended command is az disk, which is a core subcommand within the Azure Command-Line Interface (Azure CLI). This analysis focuses on az disk, a powerful tool for managing Azure managed disks. Azure managed disks are block-level storage volumes used with Azure Virtual Machines, fully managed by Azure. The az disk command provides functionalities to create, delete, list, show details, update, and manage various aspects of these disks, including their size, performance tiers (SKUs), encryption settings, and associated snapshots. It facilitates automation and scripting of disk operations within the Azure cloud environment, allowing users to provision and configure storage for their virtual machines and other Azure services programmatically. It's an essential tool for cloud administrators and developers working with Azure infrastructure.
CAVEATS
- The az disk command requires the Azure CLI to be installed and properly configured on your system.
- An active Azure subscription and authenticated session (using az login) are necessary to perform operations.
- Disk creation and management operations incur costs based on Azure's pricing for managed disks and associated resources.
- Users must have appropriate Azure RBAC (Role-Based Access Control) permissions to manage disks within a given subscription or resource group.
- Operations can be resource-intensive and may take time to complete, especially for large disks or complex tasks.
INSTALLATION AND AUTHENTICATION
To use az disk, first install the Azure CLI. Instructions are available on Microsoft's Azure documentation website for various operating systems. After installation, authenticate your session using az login, which will open a browser for Azure credential verification. This step is crucial for the CLI to interact with your Azure subscription.
RESOURCE GROUPS
All Azure resources, including disks, are deployed into Resource Groups. It is a best practice to organize related resources into the same resource group for easier management, billing, and lifecycle operations. Many az disk commands require specifying the resource group using the --resource-group or -g option.
HISTORY
The Azure CLI, which includes the az disk command set, was first introduced in 2015 as a cross-platform tool for managing Azure resources. Since its inception, the az disk command has continuously evolved to support new features and capabilities of Azure Managed Disks, which became generally available in 2017. Significant developments include support for various disk SKUs (Standard HDD/SSD, Premium SSD, Ultra SSD), encryption options (platform-managed keys, customer-managed keys), disk resizing, and advanced access controls. It has become a foundational component for automating infrastructure-as-code deployments and operational tasks involving persistent storage in Azure.
SEE ALSO
az vm: Manages Azure Virtual Machines, which frequently use Azure disks., az snapshot: Manages Azure disk snapshots, often used as sources for new disks or for backup., az group: Manages Azure resource groups, which are logical containers for Azure resources including disks., az network: Manages Azure networking components, related to how VMs (and thus disks) connect within Azure., Note: These are Azure CLI commands and do not have traditional Linux manual ('man') sections.