az deployment group

Manage Azure Resource Manager template deployment at resource group.

Commands

az deployment group cancel

Cancel a deployment at resource group.

az deployment group create

Start a deployment at resource group.

az deployment group delete

Delete a deployment at resource group.

az deployment group export

Export the template used for a deployment.

az deployment group list

List deployments at resource group.

az deployment group show

Show a deployment at resource group.

az deployment group validate

Validate whether a template is valid at resource group.

az deployment group wait

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

az deployment group what-if

Execute a deployment What-If operation at resource group scope.

az deployment group cancel

Cancel a deployment at resource group.

az deployment group cancel --name
                           --resource-group
                           [--subscription]

Examples

Cancel a deployment at resource group.

az deployment group cancel -g testrg -n deployment01

Required Parameters

--name -n

The deployment name.

--resource-group -g

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 deployment group create

Start a deployment at resource group.

az deployment group create --resource-group
                           [--aux-subs]
                           [--aux-tenants]
                           [--confirm-with-what-if]
                           [--handle-extended-json-format]
                           [--mode {Complete, Incremental}]
                           [--name]
                           [--no-prompt {false, true}]
                           [--no-wait]
                           [--parameters]
                           [--rollback-on-error]
                           [--subscription]
                           [--template-file]
                           [--template-spec]
                           [--template-uri]
                           [--what-if-exclude-change-types {Create, Delete, Deploy, Ignore, Modify, NoChange}]
                           [--what-if-result-format {FullResourcePayloads, ResourceIdOnly}]

Examples

Create a deployment at resource group from a remote template file, using parameters from a local JSON file.

az deployment group create --resource-group testrg --name rollout01 \
    --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json

Create a deployment at resource group from a local template file, using parameters from a JSON string.

az deployment group create --resource-group testrg --name rollout01 \
    --template-file azuredeploy.json  \
    --parameters '{ \"policyName\": { \"value\": \"policy2\" } }'

Create a deployment at resource group from a local template file, using parameters from an array string.

az deployment group create --resource-group testgroup --template-file demotemplate.json --parameters exampleString='inline string' exampleArray='("value1", "value2")'

Create a deployment at resource group from a local template, using a parameter file, a remote parameter file, and selectively overriding key/value pairs.

az deployment group create --resource-group testrg --name rollout01 \
    --template-file azuredeploy.json  --parameters @params.json \
    --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json

Create a deployment at subscription scope from a template-spec

az deployment group create --resource-group testrg --template-spec "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Resources/templateSpecs/myTemplateSpec/versions/1.0"

Required Parameters

--resource-group -g

The resource group to create deployment at.

Optional Parameters

--aux-subs

Auxiliary subscriptions which will be used during deployment across tenants.

--aux-tenants

Auxiliary tenants which will be used during deployment across tenants.

--confirm-with-what-if -c

Instruct the command to run deployment What-If before executing the deployment. It then prompts you to acknowledge resource changes before it continues.

--handle-extended-json-format -j

Support to handle extended template content including multiline and comments in deployment.

--mode

The deployment mode.

accepted values: Complete, Incremental
default value: Incremental
--name -n

The deployment name.

--no-prompt

The option to disable the prompt of missing parameters for ARM template. When the value is true, the prompt requiring users to provide missing parameter will be ignored. The default value is false.

accepted values: false, true
--no-wait

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

--parameters -p

Supply deployment parameter values.

--rollback-on-error

The name of a deployment to roll back to on error, or use as a flag to roll back to the last successful deployment.

--subscription

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

--template-file -f

The path to the template file.

--template-spec -s

The template spec resource id.

--template-uri -u

The URI to the template file.

--what-if-exclude-change-types -x

Space-separated list of resource change types to be excluded from What-If results. Applicable when --confirm-with-what-if is set.

accepted values: Create, Delete, Deploy, Ignore, Modify, NoChange
--what-if-result-format -r

The format of What-If results. Applicable when --confirm-with-what-if is set.

accepted values: FullResourcePayloads, ResourceIdOnly
default value: FullResourcePayloads

az deployment group delete

Delete a deployment at resource group.

az deployment group delete --name
                           --resource-group
                           [--no-wait]
                           [--subscription]

Examples

Delete a deployment at resource group.

az deployment group delete -g testrg -n deployment01

Required Parameters

--name -n

The deployment name.

--resource-group -g

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.

az deployment group export

Export the template used for a deployment.

az deployment group export --name
                           --resource-group
                           [--subscription]

Examples

Export the template used for a deployment at resource group.

az deployment group export --resource-group testrg --name MyDeployment

Required Parameters

--name -n

The deployment name.

--resource-group -g

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 deployment group list

List deployments at resource group.

az deployment group list --resource-group
                         [--filter]
                         [--query-examples]
                         [--subscription]

Examples

List deployments at resource group.

az deployment group list -g testrg

Required Parameters

--resource-group -g

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

Optional Parameters

--filter

Filter expression using OData notation. You can use --filter "provisioningState eq '{state}'" to filter provisioningState. To get more information, please visit https://docs.microsoft.com/en-us/rest/api/resources/deployments/listatsubscriptionscope#uri-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 deployment group show

Show a deployment at resource group.

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

Examples

Show a deployment at resource group.

az deployment group show -g testrg -n deployment01

Required Parameters

--name -n

The deployment name.

--resource-group -g

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 deployment group validate

Validate whether a template is valid at resource group.

az deployment group validate --resource-group
                             [--handle-extended-json-format]
                             [--mode {Complete, Incremental}]
                             [--name]
                             [--no-prompt {false, true}]
                             [--parameters]
                             [--rollback-on-error]
                             [--subscription]
                             [--template-file]
                             [--template-spec]
                             [--template-uri]

Examples

Validate whether a template is valid at resource group.

az deployment group validate --resource-group testrg --template-file {template-file}

Validate whether a template is valid at resource group. (autogenerated)

az deployment group validate --parameters MyValue=This MyArray=@array.json --resource-group testrg --template-file azuredeploy.json

Required Parameters

--resource-group -g

The resource group to create deployment at.

Optional Parameters

--handle-extended-json-format -j

Support to handle extended template content including multiline and comments in deployment.

--mode

The deployment mode.

accepted values: Complete, Incremental
default value: Incremental
--name -n

The deployment name.

--no-prompt

The option to disable the prompt of missing parameters for ARM template. When the value is true, the prompt requiring users to provide missing parameter will be ignored. The default value is false.

accepted values: false, true
--parameters -p

Supply deployment parameter values.

--rollback-on-error

The name of a deployment to roll back to on error, or use as a flag to roll back to the last successful deployment.

--subscription

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

--template-file -f

The path to the template file.

--template-spec -s

The template spec resource id.

--template-uri -u

The URI to the template file.

az deployment group wait

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

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

Examples

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

az deployment group wait --created --name MyDeployment --resource-group MyResourceGroup

Required Parameters

--name -n

The deployment name.

--resource-group -g

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

az deployment group what-if

Execute a deployment What-If operation at resource group scope.

az deployment group what-if --resource-group
                            [--aux-tenants]
                            [--exclude-change-types {Create, Delete, Deploy, Ignore, Modify, NoChange}]
                            [--mode {Complete, Incremental}]
                            [--name]
                            [--no-pretty-print]
                            [--no-prompt {false, true}]
                            [--parameters]
                            [--result-format {FullResourcePayloads, ResourceIdOnly}]
                            [--subscription]
                            [--template-file]
                            [--template-spec]
                            [--template-uri]

Examples

Execute a deployment What-If operation at a resource group.

az deployment group what-if --resource-group testrg --name rollout01 --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json

Execute a deployment What-If operation at a resource group with ResourceIdOnly format.

az deployment group what-if --resource-group testrg --name rollout01 --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json --result-format ResourceIdOnly

Execute a deployment What-If operation at a resource group without pretty-printing the result.

az deployment group what-if --resource-group testrg --name rollout01 --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json --no-pretty-print

Required Parameters

--resource-group -g

The resource group to execute deployment What-If operation at.

Optional Parameters

--aux-tenants

Auxiliary tenants which will be used during deployment across tenants.

--exclude-change-types -x

Space-separated list of resource change types to be excluded from What-If results.

accepted values: Create, Delete, Deploy, Ignore, Modify, NoChange
--mode

The deployment mode.

accepted values: Complete, Incremental
default value: Incremental
--name -n

The deployment name.

--no-pretty-print

Disable pretty-print for What-If results. When set, the output format type will be used.

--no-prompt

The option to disable the prompt of missing parameters for ARM template. When the value is true, the prompt requiring users to provide missing parameter will be ignored. The default value is false.

accepted values: false, true
--parameters -p

Supply deployment parameter values.

--result-format -r

The format of What-If results.

accepted values: FullResourcePayloads, ResourceIdOnly
default value: FullResourcePayloads
--subscription

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

--template-file -f

The path to the template file.

--template-spec -s

The template spec resource id.

--template-uri -u

The URI to the template file.