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

Examples

Create a new resource group in the West US region.

az group create -l westus -n MyResourceGroup

Required Parameters

--location -l
Location. You can configure the default location using `az configure --defaults location=<location>`.
--name -n
Name of the new resource group.

Optional Parameters

--tags
Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

az group delete

Delete a resource group.

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

Examples

Delete a resource group.

az group delete -n MyResourceGroup

Required Parameters

--name -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.
--yes -y
Do not prompt for confirmation.

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 -n
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.

az group export

Captures a resource group as a template.

az group export --name
[--include-comments]
[--include-parameter-default-value]

Required Parameters

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

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.

az group show

Gets a resource group.

az group show --name

Required Parameters

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

az group update

Update a resource group.

az group update --name
[--add]
[--remove]
[--set]

Required Parameters

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

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]

Required Parameters

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

Optional Parameters

--created
Wait till 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 till deleted.
--exists
Wait till the resource exists.
--interval
Polling interval in seconds.
default value: 30
--timeout
Maximum wait in seconds.
default value: 3600
--updated
Wait till updated with provisioningState at 'Succeeded'.