az group

Manage resource groups and template deployments.

Commands

az group create

Create a new resource group.

az group delete

Delete a resource group.

az group deployment

Manage Azure Resource Manager deployments.

az group deployment cancel

Cancels a currently running template deployment.

az group deployment create

Start a deployment.

az group deployment delete

Deletes a deployment from the deployment history.

az group deployment export

Export the template used for a deployment.

az group deployment list

Get all the deployments for a resource group.

az group deployment operation

Manage deployment operations.

az group deployment operation list

Gets all deployments operations for a deployment.

az group deployment operation show

Get a deployment's operation.

az group deployment show

Gets a deployment.

az group deployment validate

Validate whether a template is syntactically correct.

az group deployment wait

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

az group exists

Check if a resource group exists.

az group export

Captures a resource group as a template.

az group list

List resource groups.

az group lock

Manage Azure resource group locks.

az group lock create

Create a resource group lock.

az group lock delete

Delete a resource group lock.

az group lock list

List lock information in the resource-group.

az group lock show

Show the details of a resource group lock.

az group lock update

Update a resource group lock.

az group show

Gets a resource group.

az group update

Update a resource group.

az group wait

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

az group create

Create a new resource group.

az group create --location
                --name
                [--managed-by]
                [--subscription]
                [--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.

--subscription

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

--tags

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

az group delete

Delete a resource group.

az group delete --name
                [--no-wait]
                [--subscription]
                [--yes]

Examples

Delete a resource group.

az group delete -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>.

Optional Parameters

--no-wait

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

--subscription

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

--yes -y

Do not prompt for confirmation.

az group exists

Check if a resource group exists.

az group exists --name
                [--subscription]

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>.

Optional Parameters

--subscription

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

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]
                [--subscription]

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.

--include-parameter-default-value

Export template parameter with default value.

--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.

--skip-resource-name-params

Export template and skip resource name parameterization.

--subscription

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

az group list

List resource groups.

az group list [--query-examples]
              [--subscription]
              [--tag]

Examples

List all resource groups located in the West US region.

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

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

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

--tag

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

az group show

Gets a resource group.

az group show --name
              [--query-examples]
              [--subscription]

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

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

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

az group update

Update a resource group.

az group update --name
                [--add]
                [--force-string]
                [--remove]
                [--set]
                [--subscription]
                [--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

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--force-string

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

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--set

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

--subscription

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

--tags

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

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]
              [--subscription]
              [--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'.

--custom

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

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--interval

Polling interval in seconds.

default value: 30
--subscription

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

--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.