az group
Manage resource groups in your Azure subscription.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az group create |
Create a new resource group. |
Core | Preview |
| az group delete |
Delete a resource group and all resources it contains. |
Core | Preview |
| az group exists |
Check whether a resource group exists. |
Core | Preview |
| az group list |
List all resource groups in a subscription. |
Core | Preview |
| az group show |
Show details of a specific resource group. |
Core | Preview |
| az group update |
Update a resource group. |
Core | Preview |
az group create
Create a new resource group.
Provision a new resource group in your Azure subscription. Specify the resource group name and location (region). The subscription ID is optional and defaults to the current subscription when omitted. The resource group will be created immediately and can be used to organize your Azure resources.
az group create --location
--name
[--profile]
[--subscription-id]
Examples
Create a resource group in the current subscription
az group create --name myresourcegroup --location eastus
Create a resource group in a specific subscription
az group create --name myresourcegroup --location eastus --subscription-id 00000000-0000-0000-0000-000000000000
Create a resource group in West US
az group create --name myrg --location westus --subscription-id 00000000-0000-0000-0000-000000000000
Required Parameters
Location for resource group.
The name of the 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.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az group delete
Delete a resource group and all resources it contains.
Delete a resource group and all resources it contains. The command waits for deletion to finish.
az group delete --name
[--force-deletion-types {Microsoft.Compute/virtualMachines, Microsoft.Compute/virtualMachineScaleSets, Microsoft.Databricks/workspaces}]
[--profile]
[--subscription-id]
Examples
Delete a resource group
az group delete --name myresourcegroup
Force deletion of supported virtual machines
az group delete --name myresourcegroup --force-deletion-types Microsoft.Compute/virtualMachines
Required Parameters
The name of the 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.
The resource type to force delete.
| Property | Value |
|---|---|
| Accepted values: | Microsoft.Compute/virtualMachines, Microsoft.Compute/virtualMachineScaleSets, Microsoft.Databricks/workspaces |
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az group exists
Check whether a resource group exists.
Check whether a resource group exists in a subscription. The command returns true when the resource group exists and false when it does not. The subscription defaults to the active profile when --subscription-id is omitted.
az group exists --name
[--profile]
[--subscription-id]
Examples
Check whether a resource group exists
az group exists --name myresourcegroup
Check in a specific subscription
az group exists --name myresourcegroup --subscription-id 00000000-0000-0000-0000-000000000000
Required Parameters
The name of the 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.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az group list
List all resource groups in a subscription.
Retrieve a list of all resource groups in the specified Azure subscription. If no subscription ID is provided, the default subscription from your current login context is used. Output includes group names and locations.
az group list [--profile]
[--subscription-id]
Examples
List all resource groups
az group list --subscription-id 00000000-0000-0000-0000-000000000000
List using default subscription
az group list
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az group show
Show details of a specific resource group.
Display information about a resource group including its name, location, provisioning state, and resource count. Specify the resource group name and optionally the subscription ID (defaults to current subscription if not provided).
az group show --name
[--profile]
[--subscription-id]
Examples
Show a resource group
az group show --name myresourcegroup --subscription-id 00000000-0000-0000-0000-000000000000
Show using default subscription
az group show --name myresourcegroup
Required Parameters
The name of the 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.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az group update
Update a resource group.
Update a resource group without recreating it. Replace all tags with --tags, clear tags with an empty value, or modify an individual patchable property with --set. Use --force-string with --set when a value that resembles JSON, a number, or a boolean must remain a string.
az group update --name
[--force-string]
[--profile]
[--set]
[--subscription-id]
[--tags]
Examples
Replace the tags on a resource group
az group update --name myresourcegroup --tags Environment=Production Owner=Platform
Clear all tags from a resource group
az group update --resource-group myresourcegroup --tags ""
Update one tag while preserving its string value
az group update --name myresourcegroup --set tags.CostCenter=042 --force-string
Required Parameters
Name of 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.
Preserve string literals when using --set instead of attempting to convert them to JSON.
Use the named profile for this command (overrides the active profile).
Update a property by specifying a property path and value.
Azure Subscription Id. Defaults to the active profile's subscription.
Space-separated tags in key[=value] format. Use an empty string to clear existing tags.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.