Share via


az deployment tenant

Manage Azure Resource Manager template deployment at tenant scope.

Commands

Name Description Type Status
az deployment tenant cancel

Cancel a deployment at tenant scope.

Core GA
az deployment tenant create

Start a deployment at tenant scope.

Core GA
az deployment tenant delete

Delete a deployment at tenant scope.

Core GA
az deployment tenant export

Export the template used for a deployment.

Core GA
az deployment tenant list

List deployments at tenant scope.

Core GA
az deployment tenant show

Show a deployment at tenant scope.

Core GA
az deployment tenant validate

Validate whether a template is valid at tenant scope.

Core GA
az deployment tenant wait

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

Core GA
az deployment tenant what-if

Execute a deployment What-If operation at tenant scope.

Core GA

az deployment tenant cancel

Cancel a deployment at tenant scope.

az deployment tenant cancel --name

Examples

Cancel a deployment at tenant scope.

az deployment tenant cancel -n deployment01

Required Parameters

--name -n

The deployment name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant create

Start a deployment at tenant scope.

Please specify only one of --template-file FILE | --template-uri URI | --template-spec to input the ARM template.

az deployment tenant create --location
                            [--confirm-with-what-if]
                            [--handle-extended-json-format]
                            [--name]
                            [--no-prompt {false, true}]
                            [--no-wait]
                            [--parameters]
                            [--proceed-if-no-change]
                            [--query-string]
                            [--template-file]
                            [--template-spec]
                            [--template-uri]
                            [--what-if]
                            [--what-if-exclude-change-types {Create, Delete, Deploy, Ignore, Modify, NoChange, Unsupported}]
                            [--what-if-result-format {FullResourcePayloads, ResourceIdOnly}]

Examples

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

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

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

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

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

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

Required Parameters

--location -l

The location to store the deployment metadata.

Optional Parameters

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

Option '--handle-extended-json-format/-j' has been deprecated and will be removed in a future release.

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

--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
Default value: False
--no-wait

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

Default value: False
--parameters -p

Supply deployment parameter values.

Parameters may be supplied from a file using the @{path} syntax, a JSON string, or as <KEY=VALUE> 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.

--proceed-if-no-change

Instruct the command to execute the deployment if the What-If result contains no resource changes. Applicable when --confirm-with-what-if is set.

--query-string -q

The query string (a SAS token) to be used with the template-uri in the case of linked templates.

--template-file -f

The path to the template file or Bicep file.

--template-spec -s

The template spec resource id.

--template-uri -u

The URI to the template file.

--what-if -w

Instruct the command to run deployment What-If.

--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, Unsupported
--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
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant delete

Delete a deployment at tenant scope.

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

Examples

Delete a deployment at tenant scope.

az deployment tenant delete -n deployment01

Required Parameters

--name -n

The deployment name.

Optional Parameters

--no-wait

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

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant export

Export the template used for a deployment.

az deployment tenant export --name

Examples

Export the template used for a deployment at tenant scope.

az deployment tenant export --name MyDeployment

Required Parameters

--name -n

The deployment name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant list

List deployments at tenant scope.

az deployment tenant list [--filter]

Examples

List deployments at tenant scope.

az deployment tenant list

Optional Parameters

--filter
Preview

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/rest/api/resources/deployments/listatsubscriptionscope#uri-parameters.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant show

Show a deployment at tenant scope.

az deployment tenant show --name

Examples

Show a deployment at tenant scope.

az deployment tenant show -n deployment01

Required Parameters

--name -n

The deployment name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant validate

Validate whether a template is valid at tenant scope.

Please specify only one of --template-file FILE | --template-uri URI | --template-spec to input the ARM template.

az deployment tenant validate --location
                              [--handle-extended-json-format]
                              [--name]
                              [--no-prompt {false, true}]
                              [--parameters]
                              [--query-string]
                              [--template-file]
                              [--template-spec]
                              [--template-uri]

Examples

Validate whether a template is valid at tenant scope.

az deployment tenant validate --location WestUS --template-file {template-file}

Validate whether a template is valid at tenant scope. (autogenerated)

az deployment tenant validate --location WestUS --name mydeployment --parameters @myparameters.json --template-file azuredeploy.json

Required Parameters

--location -l

The location to store the deployment metadata.

Optional Parameters

--handle-extended-json-format -j
Deprecated

Option '--handle-extended-json-format/-j' has been deprecated and will be removed in a future release.

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

--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
Default value: False
--parameters -p

Supply deployment parameter values.

Parameters may be supplied from a file using the @{path} syntax, a JSON string, or as <KEY=VALUE> 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.

--query-string -q

The query string (a SAS token) to be used with the template-uri in the case of linked templates.

--template-file -f

The path to the template file or Bicep file.

--template-spec -s

The template spec resource id.

--template-uri -u

The URI to the template file.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant wait

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

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

Examples

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

az deployment tenant wait --deleted --name MyDeployment

Required Parameters

--name -n

The deployment 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
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az deployment tenant what-if

Execute a deployment What-If operation at tenant scope.

Please specify only one of --template-file FILE | --template-uri URI | --template-spec to input the ARM template.

az deployment tenant what-if --location
                             [--exclude-change-types {Create, Delete, Deploy, Ignore, Modify, NoChange, Unsupported}]
                             [--name]
                             [--no-pretty-print]
                             [--no-prompt {false, true}]
                             [--parameters]
                             [--query-string]
                             [--result-format {FullResourcePayloads, ResourceIdOnly}]
                             [--template-file]
                             [--template-spec]
                             [--template-uri]

Examples

Execute a deployment What-If operation at tenant scope.

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

Execute a deployment What-If operation at tenant scope with ResourceIdOnly format.

az deployment tenant what-if --location WestUS --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json --result-format ResourceIdOnly

Execute a deployment What-If operation at tenant scope without pretty-printing the result.

az deployment tenant what-if --location WestUS --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json --no-pretty-print

Required Parameters

--location -l

The location to store the deployment What-If operation metadata.

Optional Parameters

--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, Unsupported
--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
Default value: False
--parameters -p

Supply deployment parameter values.

Parameters may be supplied from a file using the @{path} syntax, a JSON string, or as <KEY=VALUE> 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.

--query-string -q

The query string (a SAS token) to be used with the template-uri in the case of linked templates.

--result-format -r

The format of What-If results.

Accepted values: FullResourcePayloads, ResourceIdOnly
Default value: FullResourcePayloads
--template-file -f

The path to the template file or Bicep file.

--template-spec -s

The template spec resource id.

--template-uri -u

The URI to the template file.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.