Share via


az group

Manage resource groups and template deployments.

Commands

Name Description Type Status
az group create

Create a new resource group.

Core GA
az group delete

Delete a resource group.

Core GA
az group deployment

Manage Azure Resource Manager deployments.

Core Deprecated
az group deployment cancel

Cancels a currently running template deployment.

Core Deprecated
az group deployment create

Start a deployment.

Core Deprecated
az group deployment delete

Deletes a deployment from the deployment history.

Core Deprecated
az group deployment export

Export the template used for a deployment.

Core Deprecated
az group deployment list

Get all the deployments for a resource group.

Core Deprecated
az group deployment operation

Manage deployment operations.

Core Deprecated
az group deployment operation list

Gets all deployments operations for a deployment.

Core Deprecated
az group deployment operation show

Get a deployment's operation.

Core Deprecated
az group deployment show

Gets a deployment.

Core Deprecated
az group deployment validate

Validate whether a template is syntactically correct.

Core Deprecated
az group deployment wait

Place the CLI in a waiting state until a deployment condition is met.

Core Deprecated
az group exists

Check if a resource group exists.

Core GA
az group export

Captures a resource group as a template.

Core GA
az group list

List resource groups.

Core GA
az group lock

Manage Azure resource group locks.

Core GA
az group lock create

Create a resource group lock.

Core GA
az group lock delete

Delete a resource group lock.

Core GA
az group lock list

List lock information in the resource-group.

Core GA
az group lock show

Show the details of a resource group lock.

Core GA
az group lock update

Update a resource group lock.

Core GA
az group show

Gets a resource group.

Core GA
az group update

Update a resource group.

Core GA
az group wait

Place the CLI in a waiting state until a condition of the resource group is met.

Core GA

az group create

Create a new resource group.

az group create --location
                --name
                [--managed-by]
                [--tags]

Examples

Create a new resource group in the West US region.

az group create -l westus -n MyResourceGroup

Required Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--name --resource-group -g -n

Name of the new resource group.

Optional Parameters

--managed-by

The ID of the resource that manages this resource group.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group delete

Delete a resource group.

az group delete --name
                [--force-deletion-types {Microsoft.Compute/virtualMachineScaleSets, Microsoft.Compute/virtualMachines, Microsoft.Databricks/workspaces}]
                [--no-wait]
                [--yes]

Examples

Delete a resource group.

az group delete -n MyResourceGroup

Force delete all the Virtual Machines in a resource group.

az group delete -n MyResourceGroup --force-deletion-types Microsoft.Compute/virtualMachines

Required Parameters

--name --resource-group -g -n

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--force-deletion-types -f

The resource types you want to force delete.

Accepted values: Microsoft.Compute/virtualMachineScaleSets, Microsoft.Compute/virtualMachines, Microsoft.Databricks/workspaces
--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group exists

Check if a resource group exists.

az group exists --name

Examples

Check if 'MyResourceGroup' exists.

az group exists -n MyResourceGroup

Required Parameters

--name --resource-group -g -n

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group export

Captures a resource group as a template.

az group export --name
                [--include-comments]
                [--include-parameter-default-value]
                [--resource-ids]
                [--skip-all-params]
                [--skip-resource-name-params]

Required Parameters

--name --resource-group -g -n

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--include-comments

Export template with comments.

Default value: False
--include-parameter-default-value

Export template parameter with default value.

Default value: False
--resource-ids

Space-separated resource ids to filter the export by. To export all resources, do not specify this argument or supply "*".

--skip-all-params

Export template parameter and skip all parameterization.

Default value: False
--skip-resource-name-params

Export template and skip resource name parameterization.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group list

List resource groups.

az group list [--tag]

Examples

List all resource groups located in the West US region.

az group list --query "[?location=='westus']"

Optional Parameters

--tag

A single tag in 'key[=value]' format. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group show

Gets a resource group.

az group show --name

Required Parameters

--name --resource-group -g -n

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group update

Update a resource group.

az group update --name
                [--force-string]
                [--set]
                [--tags]

Examples

Update a resource group. (autogenerated)

az group update --resource-group MyResourceGroup --set tags.CostCenter='{"Dept":"IT","Environment":"Test"}'

Required Parameters

--name --resource-group -g -n

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Default value: False
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Default value: []
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group wait

Place the CLI in a waiting state until a condition of the resource group is met.

az group wait --name
              [--created]
              [--custom]
              [--deleted]
              [--exists]
              [--interval]
              [--timeout]
              [--updated]

Examples

Place the CLI in a waiting state until a condition of the resource group is met. (autogenerated)

az group wait --created  --resource-group MyResourceGroup

Place the CLI in a waiting state until a condition of the resource group is met. (autogenerated)

az group wait --deleted --resource-group MyResourceGroup

Required Parameters

--name --resource-group -g -n

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--interval

Polling interval in seconds.

Default value: 30
--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.