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
@@ -13,7 +13,7 @@ Before deploying a template, you might want to preview the changes that will hap
13
13
> [!NOTE]
14
14
> The what-if operation is currently in preview. To use it, you must [sign up for the preview](https://aka.ms/armtemplatepreviews). As a preview release, the results may sometimes show that a resource will change when actually no change will happen. We're working to reduce these issues, but we need your help. Please report these issues at [https://aka.ms/whatifissues](https://aka.ms/whatifissues).
15
15
16
-
You can use the what-if operation with the `New-AzDeploymentWhatIf`PowerShell command or the [Deployments - What If](/rest/api/resources/deployments/whatif)REST operation.
16
+
You can use the what-if operation with the PowerShell commands or REST API operations.
17
17
18
18
In PowerShell, the output looks like:
19
19
@@ -37,13 +37,25 @@ The what-if operation lists six different types of changes:
37
37
38
38
## Deployment scope
39
39
40
-
You can use the what-if operation for deployments at either the subscription or resource group level. You set the deployment scope with the `-ScopeType` parameter. The accepted values are `Subscription` and `ResourceGroup`. This article demonstrates resource group deployments.
40
+
You can use the what-if operation for deployments at either the subscription or resource group level.
41
+
42
+
For PowerShell, use:
43
+
44
+
***Get-AzResourceGroupDeploymentWhatIf** for resource group deployments
45
+
***Get-AzSubscriptionDeploymentWhatIf** or **Get-AzDeploymentWhatIf** for subscription level deployments
46
+
47
+
For REST API, use:
48
+
49
+
*[Deployments - What If](/rest/api/resources/deployments/whatif) for resource group deployments
50
+
*[Deployments - What If At Subscription Scope](/rest/api/resources/deployments/whatifatsubscriptionscope) for subscription level deployments
41
51
42
52
To learn about subscription level deployments, see [Create resource groups and resources at the subscription level](deploy-to-subscription.md#).
43
53
54
+
This article demonstrates resource group deployments.
55
+
44
56
## Result format
45
57
46
-
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`.
58
+
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`.
47
59
48
60
The following screenshots show the two different output formats:
After the deployment completes, you're ready to test the what-if operation. Run the what-if command but change the storage account type to `Standard_GRS`.
Notice at the top of the output that colors are defined to indicate the type of changes.
90
120
91
121
At the bottom of the output, it shows the sku name (storage account type) will be changed from **Standard_LRS** to **Standard_GRS**.
92
122
93
-
Some of the properties that are listed as deleted won't actually change. In the preceding image, these properties are accessTier, encryption.keySource and others in that section. Properties can be incorrectly reported as deleted when they aren't in the template, but are automatically set during deployment as default values. This result is considered "noise" in the what-if response. The final deployed resource will have the values set for the properties. As the what-if operation matures, these properties will be filtered out of the result.
123
+
Some of the properties that are listed as deleted won't actually change. In the preceding image, the accessTier property is listed as being deleted. Properties can be incorrectly reported as deleted when they aren't in the template, but are automatically set during deployment as default values. This result is considered "noise" in the what-if response. The final deployed resource will have the values set for the properties. As the what-if operation matures, these properties will be filtered out of the result.
0 commit comments