az deployment

Manage Azure Resource Manager deployments at subscription scope.

Commands

az deployment create Start a deployment.
az deployment delete Deletes a deployment from the deployment history.
az deployment export Export the template used for a deployment.
az deployment list Get all the deployments for a subscription.
az deployment operation Manage deployment operations.
az deployment operation list Gets all deployments operations for a deployment.
az deployment operation show Get a deployment's operation.
az deployment show Gets a deployment.
az deployment validate Validate whether a template is syntactically correct.
az deployment wait Place the CLI in a waiting state until a deployment condition is met.

az deployment create

Start a deployment.

az deployment create --location
[--name]
[--no-wait]
[--parameters]
[--subscription]
[--template-file]
[--template-uri]

Examples

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

az deployment create --location WestUS --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json

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

az deployment create --location WestUS --template-file azuredeploy.json --parameters '{
                                "policyName": {
                                    "value": "policy2"
                                }
                            }'

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

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

Required Parameters

--location -l

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

Optional Parameters

--name -n

The deployment name. Default to template file base name.

--no-wait

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

--parameters

Supply deployment parameter values.

--subscription

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

--template-file

A template file path in the file system.

--template-uri

A uri to a remote template file.

az deployment delete

Deletes a deployment from the deployment history.

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

Required Parameters

--name -n

The deployment 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 export

Export the template used for a deployment.

az deployment export --name
[--subscription]

Examples

Export the template used for a deployment. (autogenerated)

az deployment export --name MyDeployment

Required Parameters

--name -n

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

Get all the deployments for a subscription.

az deployment list [--filter]
[--subscription]
[--top]

Optional Parameters

--filter

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

--subscription

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

--top

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

az deployment show

Gets a deployment.

az deployment show --name
[--subscription]

Required Parameters

--name -n

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

Validate whether a template is syntactically correct.

az deployment validate --location
[--parameters]
[--subscription]
[--template-file]
[--template-uri]

Examples

Validate whether a template is syntactically correct. (autogenerated)

az deployment validate --location westus2 --template-file {template-file}

Required Parameters

--location -l

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

Optional Parameters

--parameters

Supply deployment parameter values.

--subscription

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

--template-file

A template file path in the file system.

--template-uri

A uri to a remote template file.

az deployment wait

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

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

Required Parameters

--name -n

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