You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/templates/template-deploy-what-if.md
+103-9Lines changed: 103 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,14 +35,19 @@ The what-if operation lists six different types of changes:
35
35
36
36
-**Deploy**: The resource exists, and is defined in the template. The resource will be redeployed. The properties of the resource may or may not change. The operation returns this change type when it doesn't have enough information to determine if any properties will change. You only see this condition when [ResultFormat](#result-format) is set to `ResourceIdOnly`.
37
37
38
-
## Deployment scope
38
+
## What-if commands
39
39
40
-
You can use the what-if operation for deployments at either the subscription or resource group level.
40
+
You can use the what-if operation for deployments at either the subscription or resource group level.
41
41
42
42
For PowerShell, use:
43
43
44
-
***Get-AzResourceGroupDeploymentWhatIf** for resource group deployments
45
-
***Get-AzSubscriptionDeploymentWhatIf** or **Get-AzDeploymentWhatIf** for subscription level deployments
44
+
*`Get-AzResourceGroupDeploymentWhatIf` for resource group deployments
45
+
*`Get-AzSubscriptionDeploymentWhatIf` or `Get-AzDeploymentWhatIf` for subscription level deployments
46
+
47
+
> [!NOTE]
48
+
> Prior to the release of version 2.0.1-alpha5, you used the `New-AzDeploymentWhatIf` command. This command has been replaced by the `Get-Az*DeploymentWhatIf` syntax. If you've used an earlier version, you need to update those commands.
49
+
50
+
You can also run the what-if operation from the `New-AzResourceGroupDeployment`, `New-AzSubscriptionDeployment` and `New-AzDeployment` commands. Use the `-Whatif` switch parameter to run the what-if command. Use the `-Confirm` switch parameter to first run what-if and then have the option to complete the deployment.
46
51
47
52
For REST API, use:
48
53
@@ -57,15 +62,41 @@ This article demonstrates resource group deployments.
57
62
58
63
You can control the level of detail that is returned about the predicted changes. Set the **ResultFormat** parameter to **FullResourcePayloads** to get a list of resources what will change and details about the properties that will change. Set the **ResultFormat** parameter to **ResourceIdOnly** to get a list of resources that will change. The default value is `FullResourcePayloads`.
59
64
60
-
The following screenshots show the two different output formats:
65
+
The following results show the two different output formats:
@@ -127,8 +158,7 @@ Some of the properties that are listed as deleted won't actually change. In the
127
158
The what-if operation supports using [deployment mode](deployment-modes.md). When set to complete mode, resources not in the template are deleted. The following example deploys a [template that has no resources defined](https://github.com/Azure/azure-docs-json-samples/blob/master/empty-template/azuredeploy.json) in complete mode.
It's important to remember what-if makes no actual changes. The storage account still exists in your resource group.
142
196
197
+
## Confirm before deployment
198
+
199
+
To preview changes before deploying a template, use the `-Confirm` switch parameter with the deployment command. If the changes are as you expected, you can then confirm that you want the deployment to complete. The following command allows you to preview changes before the template is deployed.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
235
+
```
236
+
143
237
## Next steps
144
238
145
239
- If you notice incorrect results from the preview release of what-if, please report the issues at [https://aka.ms/whatifissues](https://aka.ms/whatifissues).
0 commit comments