az-group
Manage Azure resource groups
TLDR
Create a new resource group
Check if a resource group exists
Delete a resource group
Wait until a condition of the resource group is met
SYNOPSIS
az group <subcommand> [<global-options>]
Subcommands and their common usage:
az group create --name <resource-group-name> --location <region> [--tags <key=value>...]
az group delete --name <resource-group-name> [--no-wait] [--yes]
az group list [--tag <key[=value]>]
az group show --name <resource-group-name>
PARAMETERS
--help, -h
Displays help information for the command or subcommand.
--output, -o
Specifies the output format (e.g., json, jsonc, table, tsv, yaml, yamlc). Default is json.
--query
Defines a JMESPath query string to filter or transform the command output.
--debug
Enables debug logging, showing all debug logs for troubleshooting.
--verbose
Increases logging verbosity to show more information.
--only-show-errors
Suppresses warnings and only shows error messages.
--subscription
Specifies the Azure subscription name or ID to operate on. Overrides the default subscription.
--name, -n
(Subcommand-specific) Specifies the name of the resource group to operate on. Required for most subcommands like create, delete, show, update, and exists.
--location, -l
(Subcommand-specific, for `create`) Specifies the Azure region (e.g., 'eastus', 'westus2') where the new resource group should be created.
--tags
(Subcommand-specific, for `create`, `update`) Space-separated tags in `key[=value]` format to apply to the resource group. Used for categorization and billing.
--no-wait
(Subcommand-specific, for `delete`) Do not wait for the long-running deletion operation to finish; return immediately.
--yes, -y
(Subcommand-specific, for `delete`) Do not prompt for confirmation before proceeding with the deletion.
DESCRIPTION
The az group command is a core component of the Azure Command-Line Interface (Azure CLI), designed for comprehensive management of Azure resource groups. Resource groups are logical containers that hold related resources for an Azure solution. This command allows users to perform various operations such as creating new resource groups, deleting existing ones, listing all resource groups within a subscription, retrieving details of a specific group, and updating their properties. It's essential for organizing and managing the lifecycle of Azure resources efficiently. Operations like create, delete, list, show, update, exists, and wait are available to facilitate robust resource group management.
CAVEATS
The az group command requires the Azure CLI to be installed and configured on the system. User authentication to an Azure subscription is mandatory to perform any operations. Deleting a resource group is a highly destructive operation as it irrevocably deletes all resources contained within it. Resource group names must be unique within a subscription and adhere to Azure naming conventions, including length and allowed characters.
RESOURCE GROUP CONCEPT
In Azure, a resource group is a logical container into which Azure resources (e.g., web apps, databases, storage accounts, virtual machines) are deployed and managed. Resource groups provide a way to organize related resources, manage their lifecycle (e.g., deployment, updates, deletion) as a single unit, and apply access control using Azure Role-Based Access Control (RBAC). This organizational structure is crucial for effective cloud resource management, cost tracking, and security.
REQUIRED PERMISSIONS
To effectively manage resource groups using the az group command, the authenticated Azure identity (user or service principal) typically requires specific Azure Role-Based Access Control (RBAC) permissions. Roles such as 'Contributor' or 'Owner' at the subscription level provide broad management capabilities. For more granular control, roles like 'Resource Group Contributor' can be assigned to manage resource groups themselves, while separate permissions might be needed for the resources within those groups depending on inheritance and specific requirements.
HISTORY
Azure CLI underwent a significant architectural redesign and re-release as the 'az' CLI in 2017, succeeding the older 'azure' Xplat CLI. The az group command has been a fundamental and indispensable part of the Azure CLI since its modern incarnation, providing essential resource management capabilities. Its functionality has continuously evolved in tandem with Azure's services, incorporating new features like advanced tagging, managed identities integration, and improved resource organization paradigms.
SEE ALSO
az login(1), az account(1), az resource(1), az network(1), az vm(1)