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

Preview

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

Location for resource group.

--name

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.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az group delete

Preview

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

--name -n -resource-group -g

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.

--force-deletion-types -f

The resource type to force delete.

Property Value
Accepted values: Microsoft.Compute/virtualMachines, Microsoft.Compute/virtualMachineScaleSets, Microsoft.Databricks/workspaces
--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az group exists

Preview

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

--name -n -resource-group -g

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.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az group list

Preview

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.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az group show

Preview

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

--name

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.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az group update

Preview

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 -n -resource-group -g

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.

--force-string

Preserve string literals when using --set instead of attempting to convert them to JSON.

--profile

Use the named profile for this command (overrides the active profile).

--set

Update a property by specifying a property path and value.

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

--tags

Space-separated tags in key[=value] format. Use an empty string to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.