az group deployment

Manage Azure Resource Manager deployments.

Commands

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 deployment cancel

Cancels a currently running template deployment.

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resource group partially deployed.

az group deployment cancel --name
                           --resource-group

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

az group deployment create

Start a deployment.

az group deployment create --resource-group
                           [--aux-subs]
                           [--aux-tenants]
                           [--handle-extended-json-format]
                           [--mode {Complete, Incremental}]
                           [--name]
                           [--no-prompt {false, true}]
                           [--no-wait]
                           [--parameters]
                           [--rollback-on-error]
                           [--template-file]
                           [--template-uri]

Examples

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

az group deployment create -g MyResourceGroup --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json

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

az group deployment create -g MyResourceGroup --template-file azuredeploy.json \
    --parameters "{ \"location\": { \"value\": \"westus\" } }"

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

az group deployment create -g MyResourceGroup --template-file azuredeploy.json \
    --parameters @params.json --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json

Required Parameters

--resource-group -g

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

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.

--handle-extended-json-format -j

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

--mode

Incremental (only add resources to resource group) or Complete (remove extra resources from resource group).

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

The deployment name. Default to template file base 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
default value: False
--no-wait

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

default value: False
--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.

--template-file -f

A path to a template file or Bicep file in the file system.

--template-uri -u

A uri to a remote template file.

az group deployment delete

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.

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

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.

default value: False

az group deployment export

Export the template used for a deployment.

az group deployment export --name
                           --resource-group

Examples

Export the template used for a deployment. (autogenerated)

az group deployment export --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>.

az group deployment list

Get all the deployments for a resource group.

az group deployment list --resource-group
                         [--filter]
                         [--top]

Required Parameters

--resource-group -g

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

Optional Parameters

--filter

The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. Default value is None.

--top

The number of results to get. If null is passed, returns all deployments. Default value is None.

az group deployment show

Gets a deployment.

az group deployment show --name
                         --resource-group

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

az group deployment validate

Validate whether a template is syntactically correct.

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

Examples

Validate whether a template is syntactically correct. (autogenerated)

az group deployment validate --parameters "{ \"location\": { \"value\": \"westus\" } }" \
    --resource-group MyResourceGroup --template-file storage.json

Required Parameters

--resource-group -g

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

Optional Parameters

--handle-extended-json-format -j

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

--mode

Incremental (only add resources to resource group) or Complete (remove extra resources from resource group).

accepted values: Complete, Incremental
default value: Incremental
--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
default value: False
--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.

--template-file -f

A path to a template file or Bicep file in the file system.

--template-uri -u

A uri to a remote template file.

az group deployment wait

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

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

Examples

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

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

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

az group deployment 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'.

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