az deployment

Manage Azure Resource Manager deployments at subscription scope.

Commands

az deployment create Start a deployment.
az deployment delete Delete a deployment at subscription scope.
az deployment export Export the template used for a deployment.
az deployment list List deployments at subscription scope.
az deployment operation Manage deployment operations.
az deployment operation list List a deployment's operations.
az deployment operation show Get a deployment's operation.
az deployment show Show a deployment at subscription scope.
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
[--handle-extended-json-format]
[--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

--handle-extended-json-format -j

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

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

Delete a deployment at subscription scope.

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

Examples

Delete a deployment at subscription scope.

az deployment delete -n deployment01

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

List deployments at subscription scope.

az deployment list [--subscription]

Examples

List deployments at subscription scope.

az deployment list

Optional Parameters

--subscription

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

az deployment show

Show a deployment at subscription scope.

az deployment show --name
[--subscription]

Examples

Show a deployment at subscription scope.

az deployment show -n deployment01

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
[--handle-extended-json-format]
[--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

--handle-extended-json-format -j

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

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