Deployments - az group deployment

Manage Azure Resource Manager deployments.

Commands

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 the specified 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 the specified template is syntactically correct and will be accepted by Azure Resource Manager.
az group deployment wait Place the CLI in a waiting state until a condition of the deployment is met.

az group deployment create

Start a deployment.

az group deployment create --resource-group
[--mode {Complete, Incremental}]
[--name]
[--no-wait]
[--parameters]
[--template-file]
[--template-uri]

Examples

Create a deployment from a remote template file.

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

Create a deployment from a local template file and use parameter values in a string.

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

Create a deployment from a local template, use a parameter file and selectively override parameters.

az group deployment create -g MyResourceGroup --template-file azuredeploy.json --parameters 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=.

Optional Parameters

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

Do not wait for the long running operation to finish.

--parameters

Supply deployment parameter values.

Parameters may be supplied from a parameters file, raw JSON (which can be loaded using @ syntax, or as pairs. Parameters are evaluated in order, so when a value is assigned twice, the latter value will be used. It is recommended that you supply your parameters file first, and then override selectively using KEY=VALUE syntax (example: --parameters params.json --parameters location=westus).

--template-file

A template file path in the file system.

--template-uri

A uri to a remote template file.

az group deployment delete

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

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

az group deployment export

Export the template used for the specified deployment.

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

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

Optional Parameters

--filter

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

--top

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

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

az group deployment validate

Validate whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.

az group deployment validate --resource-group
[--mode {Complete, Incremental}]
[--parameters]
[--template-file]
[--template-uri]

Required Parameters

--resource-group -g

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

Optional Parameters

--mode

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

accepted values: Complete, Incremental
default value: incremental
--parameters

Supply deployment parameter values.

Parameters may be supplied from a parameters file, raw JSON (which can be loaded using @ syntax, or as pairs. Parameters are evaluated in order, so when a value is assigned twice, the latter value will be used. It is recommended that you supply your parameters file first, and then override selectively using KEY=VALUE syntax (example: --parameters params.json --parameters location=westus).

--template-file

A template file path in the file system.

--template-uri

A uri to a remote template file.

az group deployment wait

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

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

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

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