az stack-whatif mg
Manage Deployment stacks what-if results at management group scope.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az stack-whatif mg create |
Create a deployment stack what-if result at management group scope. |
Core | GA |
| az stack-whatif mg delete |
Delete a deployment stack what-if result from management group scope. |
Core | GA |
| az stack-whatif mg list |
List all deployment stacks what-if results in a management group. |
Core | GA |
| az stack-whatif mg show |
Get a deployment stack what-if result from management group scope. |
Core | GA |
az stack-whatif mg create
Create a deployment stack what-if result at management group scope.
az stack-whatif mg create --action-on-unmanage --aou {deleteAll, deleteResources, detachAll}
--deny-settings-mode --dm {denyDelete, denyWriteAndDelete, none}
--location
--management-group-id
--name
--retention-interval --ri
--stack-id
[--acquire-policy-token]
[--change-reference]
[--cs --deny-settings-apply-to-child-scopes]
[--deny-settings-excluded-actions --ea]
[--deny-settings-excluded-principals --ep]
[--deployment-subscription --ds]
[--description]
[--no-color]
[--no-pretty-print]
[--no-wait]
[--parameters]
[--query-string]
[--resources-without-delete-support --rwd {detach, fail}]
[--tags]
[--template-file]
[--template-spec]
[--template-uri]
[--validation-level --vl {Provider, ProviderNoRbac, Template}]
Examples
Perform a what-if on a deployment stack using template file and detach all unmanaged resources.
az stack-whatif mg create --name StackName --management-group-id myMg --template-file simpleTemplate.json --parameters simpleTemplateParams.json --location westus2 --description description --deny-settings-mode None --action-on-unmanage detachAll --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Perform a what-if on a deployment stack with template spec.
az stack-whatif mg create --name StackName --management-group-id myMg --template-spec TemplateSpecResourceIDWithVersion --location westus2 --description description --deny-settings-mode None --action-on-unmanage deleteResources --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Perform a what-if on a deployment stack using bicep file, delete all resources on unmanage, and remove color from the output.
az stack-whatif mg create --name StackName --management-group-id myMg --no-color --action-on-unmanage deleteAll --template-file simple.bicep --location westus2 --description description --deny-settings-mode None --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Perform a what-if on a deployment stack using parameters from key/value pairs.
az stack-whatif mg create --name StackName --management-group-id myMg --template-file simpleTemplate.json --location westus --description description --parameters simpleTemplateParams.json value1=foo value2=bar --deny-settings-mode None --action-on-unmanage deleteResources --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Perform a what-if on a deployment stack from a local template, using a parameter file, a remote parameter file, and selectively overriding key/value pairs.
az stack-whatif mg create --name StackName --management-group-id myMg --template-file azuredeploy.json --parameters @params.json --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json --location westus --deny-settings-mode None --action-on-unmanage deleteResources --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Perform a what-if on a deployment stack from a local template, using deny settings.
az stack-whatif mg create --name StackName --management-group-id myMg --template-file azuredeploy.json --deny-settings-mode denyDelete --deny-settings-excluded-actions Microsoft.Compute/virtualMachines/write --deny-settings-excluded-principals "test1 test2" --location westus --action-on-unmanage deleteResources --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Perform a what-if on a deployment stack from a local template, apply deny settings to child scope.
az stack-whatif mg create --name StackName --management-group-id myMg --template-file azuredeploy.json --deny-settings-mode denyDelete --deny-settings-excluded-actions Microsoft.Compute/virtualMachines/write --deny-settings-apply-to-child-scopes --location westus --action-on-unmanage deleteResources --ri P5D --stack-id /providers/Microsoft.Management/myMg/providers/Microsoft.Resources/deploymentStacks/myMgStack
Required Parameters
Defines what happens to resources that are no longer managed after the stack is updated or deleted.
| Property | Value |
|---|---|
| Accepted values: | deleteAll, deleteResources, detachAll |
Define which operations are denied on resources managed by the stack.
| Property | Value |
|---|---|
| Accepted values: | denyDelete, denyWriteAndDelete, none |
The location to store the deployment stack what-if result.
The management group ID to create a deployment stack what-if result in.
The name of the deployment stack what-if result.
The retention interval for What-If results. The value must be in ISO 8601 format and between 1 day and 30 days.
The fully-qualified ID of the deployment stack to perform a what-if operation on.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
DenySettings will be applied to child scopes.
| Property | Value |
|---|---|
| Default value: | False |
List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted.
List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted.
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.
The description of deployment stack.
Disable color in pretty-printed what-if results.
Disable pretty-print for What-If results. When set, the output format type will be used.
Do not wait for the long-running operation to finish.
| Property | Value |
|---|---|
| Default value: | False |
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.
The query string (a SAS token) to be used with the template-uri in the case of linked templates.
Defines what happens to resources that do not support deletion when they are no longer managed by the stack.
| Property | Value |
|---|---|
| Accepted values: | detach, fail |
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
A path to a template file or Bicep file in the file system.
The template spec resource id.
A uri to a remote template file.
Validation level for the deployment stack. The default is 'Provider'.
| Property | Value |
|---|---|
| Accepted values: | Provider, ProviderNoRbac, Template |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-whatif mg delete
Delete a deployment stack what-if result from management group scope.
az stack-whatif mg delete --management-group-id
[--acquire-policy-token]
[--change-reference]
[--id]
[--name]
[--yes]
Examples
Delete a stack what-if result by name.
az stack-whatif mg delete --name ResultName --management-group-id myMg
Delete a stack what-if result by resource id.
az stack-whatif mg delete --id /providers/Microsoft.Management/managementGroups/myMg/providers/Microsoft.Resources/deploymentStacksWhatIfResults/ResultName --management-group-id myMg
Required Parameters
The management group ID to create a deployment stack what-if result in.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The deployment stack what-if result resource ID.
The name of the deployment stack what-if result.
Do not prompt for confirmation.
| Property | Value |
|---|---|
| Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-whatif mg list
List all deployment stacks what-if results in a management group.
az stack-whatif mg list --management-group-id
Examples
List all stack what-if results in management group.
az stack-whatif mg list --management-group-id myMg
Required Parameters
The management group ID to create a deployment stack what-if result in.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-whatif mg show
Get a deployment stack what-if result from management group scope.
az stack-whatif mg show --management-group-id
[--id]
[--name]
[--no-color]
[--no-pretty-print]
[--with-property-changes --wpc {false, true}]
Examples
Get a stack what-if result by name.
az stack-whatif mg show --name ResultName --management-group-id myMg
Get a stack what-if result by name without color.
az stack-whatif mg show --name ResultName --management-group-id myMg --no-color
Get JSON for a stack what-if result by name.
az stack-whatif mg show --name ResultName --management-group-id myMg --no-pretty-print
Get a stack what-if result by resource id.
az stack-whatif mg show --id /providers/Microsoft.Management/managementGroups/myMg/providers/Microsoft.Resources/deploymentStacksWhatIfResults/ResultName --management-group-id myMg
Required Parameters
The management group ID to create a deployment stack what-if result in.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The deployment stack what-if result resource ID.
The name of the deployment stack what-if result.
Disable color in pretty-printed what-if results.
Disable pretty-print for What-If results. When set, the output format type will be used.
Flag to return the What-If results with resource property changes included.
| Property | Value |
|---|---|
| Accepted values: | false, true |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |