az stack sub

Manage Deployment Stacks at subscription.

Commands

Name Description Type Status
az stack sub create

Create or update a deployment stack at subscription scope.

Core GA
az stack sub delete

Delete specified deployment stack from subscription scope.

Core GA
az stack sub export

Export the template used to create the deployment stack.

Core GA
az stack sub list

List all deployment stacks in subscription.

Core GA
az stack sub show

Get specified deployment stack from subscription scope.

Core GA

az stack sub create

Create or update a deployment stack at subscription scope.

az stack sub create --deny-settings-mode {denyDelete, denyWriteAndDelete, none}
                    --location
                    --name
                    [--action-on-unmanage {deleteAll, deleteResources, detachAll}]
                    [--cs]
                    [--delete-all {false, true}]
                    [--delete-resource-groups {false, true}]
                    [--delete-resources {false, true}]
                    [--deny-settings-excluded-actions]
                    [--deny-settings-excluded-principals]
                    [--deployment-resource-group]
                    [--description]
                    [--no-wait]
                    [--parameters]
                    [--query-string]
                    [--tags]
                    [--template-file]
                    [--template-spec]
                    [--template-uri]
                    [--yes]

Examples

Create a deployment stack using template file.

az stack sub create --name StackName --template-file simpleTemplate.json --location westus2 --description description --deny-settings-mode None

Create a deployment stack with parameter file and delete resources on unmanage.

az stack sub create --name StackName --action-on-unmanage deleteResources --template-file simpleTemplate.json --parameters simpleTemplateParams.json --location westus2 --description description --deny-settings-mode None

Create a deployment stack with template spec.

az stack sub create --name StackName --template-spec TemplateSpecResourceIDWithVersion --location westus2 --description description --deny-settings-mode None

Create a deployment stack using bicep file and delete all resources on unmanage.

az stack sub create --name StackName --action-on-unmanage deleteAll --template-file simple.bicep --location westus2 --description description --deny-settings-mode None

Create a deployment stack at a different subscription.

az stack sub create --name StackName --template-file simpleTemplate.json --location westus2 --description description --subscription subscriptionId --deny-settings-mode None

Create a deployment stack and deploy at the resource group scope.

az stack sub create --name StackName --template-file simpleTemplate.json --location westus --deployment-resource-group ResourceGroup --description description --deny-settings-mode None

Create a deployment stack using parameters from key/value pairs.

az stack sub create --name StackName --template-file simpleTemplate.json --location westus --description description --parameters simpleTemplateParams.json value1=foo value2=bar --deny-settings-mode None

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

az stack sub create --name StackName --template-file azuredeploy.json --parameters @params.json --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json --location westus --deny-settings-mode None

Create a deployment stack from a local template, using deny settings.

az stack sub create --name StackName --template-file azuredeploy.json --deny-settings-mode denyDelete --deny-settings-excluded-actions Microsoft.Compute/virtualMachines/write --deny-settings-excluded-principals "test1 test2" --location westus

Create a deployment stack from a local template, apply deny settings to child scopes.

az stack sub create --name StackName --template-file azuredeploy.json --deny-settings-mode denyDelete --deny-settings-excluded-actions Microsoft.Compute/virtualMachines/write --deny-settings-apply-to-child-scopes --location westus

Required Parameters

--deny-settings-mode --dm

Define which operations are denied on resources managed by the stack.

accepted values: denyDelete, denyWriteAndDelete, none
--location -l

The location to store deployment stack.

--name -n

The name of the deployment stack.

Optional Parameters

--action-on-unmanage --aou

Defines what happens to resources that are no longer managed after the stack is updated or deleted.

accepted values: deleteAll, deleteResources, detachAll
--cs --deny-settings-apply-to-child-scopes

DenySettings will be applied to child scopes.

default value: False
--delete-all
Deprecated

Option '--delete-all' has been deprecated and will be removed in a future release. Use '--action-on-unmanage deleteAll' instead.

Flag to indicate delete rather than detach for the resources and resource groups.

accepted values: false, true
default value: False
--delete-resource-groups
Deprecated

Option '--delete-resource-groups' has been deprecated and will be removed in a future release. Use '--action-on-unmanage deleteAll' instead.

Flag to indicate delete rather than detach for the resource groups.

accepted values: false, true
default value: False
--delete-resources
Deprecated

Option '--delete-resources' has been deprecated and will be removed in a future release. Use '--action-on-unmanage deleteResources' instead.

Flag to indicate delete rather than detach for the resources.

accepted values: false, true
default value: False
--deny-settings-excluded-actions --ea

List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted.

--deny-settings-excluded-principals --ep

List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted.

--deployment-resource-group --dr

The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack.

--description

The description of deployment stack.

--no-wait

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

default value: False
--parameters -p

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.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--template-file -f

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

--template-spec -s

The template spec resource id.

--template-uri -u

A uri to a remote template file.

--yes

Do not prompt for confirmation.

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 stack sub delete

Delete specified deployment stack from subscription scope.

az stack sub delete [--action-on-unmanage {deleteAll, deleteResources, detachAll}]
                    [--delete-all {false, true}]
                    [--delete-resource-groups {false, true}]
                    [--delete-resources {false, true}]
                    [--id]
                    [--name]
                    [--yes]

Examples

Delete stack by name.

az stack sub delete --name StackName

Delete stack by stack resource id.

az stack sub delete --id /subscriptions/111111111111/providers/Microsoft.Resources/deploymentStacks/StackName

Optional Parameters

--action-on-unmanage --aou

Defines what happens to resources that are no longer managed after the stack is updated or deleted.

accepted values: deleteAll, deleteResources, detachAll
--delete-all
Deprecated

Option '--delete-all' has been deprecated and will be removed in a future release. Use '--action-on-unmanage deleteAll' instead.

Flag to indicate delete rather than detach for the resources and resource groups.

accepted values: false, true
default value: False
--delete-resource-groups
Deprecated

Option '--delete-resource-groups' has been deprecated and will be removed in a future release. Use '--action-on-unmanage deleteAll' instead.

Flag to indicate delete rather than detach for the resource groups.

accepted values: false, true
default value: False
--delete-resources
Deprecated

Option '--delete-resources' has been deprecated and will be removed in a future release. Use '--action-on-unmanage deleteResources' instead.

Flag to indicate delete rather than detach for the resources.

accepted values: false, true
default value: False
--id

The deployment stack resource id.

--name -n

The deployment stack name.

--yes

Do not prompt for confirmation.

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 stack sub export

Export the template used to create the deployment stack.

az stack sub export [--id]
                    [--name]

Examples

Export template by name.

az stack sub export --name StackName

Export template by stack resource id.

az stack sub export --id /subscriptions/111111111111/providers/Microsoft.Resources/deploymentStacks/StackName

Optional Parameters

--id

The deployment stack resource id.

--name -n

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

List all deployment stacks in subscription.

az stack sub list

Examples

List all stacks

az stack sub list
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 stack sub show

Get specified deployment stack from subscription scope.

az stack sub show [--id]
                  [--name]

Examples

Get stack by name.

az stack sub show --name StackName

Get stack by stack resource id.

az stack sub show --id /subscriptions/111111111111/providers/Microsoft.Resources/deploymentStacks/StackName

Optional Parameters

--id

The deployment stack resource id.

--name -n

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