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
-**Delete**: This change type only applies when using [complete mode](deployment-modes.md) for deployment. The resource exists, but isn't defined in the template. With complete mode, the resource will be deleted. Only resources that [support complete mode deletion](complete-mode-deletion.md) are included in this change type.
39
+
name: "subnet001"
40
+
properties.addressPrefix: "10.0.0.0/24"
29
41
30
-
-**Ignore**: The resource exists, but isn't defined in the template. The resource won't be deployed or modified.
42
+
]
31
43
32
-
-**NoChange**: The resource exists, and is defined in the template. The resource will be redeployed, but the properties of the resource won't change. This change type is returned when [ResultFormat](#result-format) is set to `FullResourcePayloads`, which is the default value.
44
+
Resource changes: 1 to modify.
45
+
```
33
46
34
-
-**Modify**: The resource exists, and is defined in the template. The resource will be redeployed, and the properties of the resource will change. This change type is returned when [ResultFormat](#result-format) is set to `FullResourcePayloads`, which is the default value.
47
+
The following image shows the color-coded results that are returned in PowerShell to help you see the different types of changes.
35
48
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`.
49
+

37
50
38
51
## What-if commands
39
52
40
53
You can use either Azure PowerShell or Azure REST API for the what-if operation.
41
54
42
55
### Azure PowerShell
43
56
44
-
To preview changes, use:
45
-
46
-
*`Get-AzResourceGroupDeploymentWhatIf` for resource group deployments
47
-
*`Get-AzSubscriptionDeploymentWhatIf` or `Get-AzDeploymentWhatIf` for subscription level deployments
48
-
49
-
Or, you can use the `-Whatif` switch parameter on the deployment command.
57
+
To see a preview of the changes before deploying a template, add the `-Whatif` switch parameter to the deployment command.
50
58
51
59
*`New-AzResourceGroupDeployment -Whatif` for resource group deployments
52
60
*`New-AzSubscriptionDeployment -Whatif` and `New-AzDeployment -Whatif` for subscription level deployments
53
61
54
-
Or, you can preview the changes before being prompted to continue with the deployment.
62
+
Or, you can use the `-Confirm` switch parameter to preview the changes and get prompted to continue with the deployment.
55
63
56
64
*`New-AzResourceGroupDeployment -Confirm` for resource group deployments
57
65
*`New-AzSubscriptionDeployment -Confirm` and `New-AzDeployment -Confirm` for subscription level deployments
58
66
67
+
The preceding commands return a text summary that you can manually inspect. To get an object that you can programmatically inspect for changes, use:
68
+
69
+
*`$results = Get-AzResourceGroupDeploymentWhatIf` for resource group deployments
70
+
*`$results = Get-AzSubscriptionDeploymentWhatIf` or `$results = Get-AzDeploymentWhatIf` for subscription level deployments
71
+
59
72
> [!NOTE]
60
73
> Prior to the release of version 2.0.1-alpha5, you used the `New-AzDeploymentWhatIf` command. This command has been replaced by the `Get-AzDeploymentWhatIf`, `Get-AzResourceGroupDeploymentWhatIf`, and `Get-AzSubscriptionDeploymentWhatIf` commands. If you've used an earlier version, you need to update that syntax. The `-ScopeType` parameter has been removed.
61
74
@@ -66,9 +79,27 @@ For REST API, use:
66
79
*[Deployments - What If](/rest/api/resources/deployments/whatif) for resource group deployments
67
80
*[Deployments - What If At Subscription Scope](/rest/api/resources/deployments/whatifatsubscriptionscope) for subscription level deployments
68
81
82
+
## Change types
83
+
84
+
The what-if operation lists six different types of changes:
85
+
86
+
-**Create**: The resource doesn't currently exist but is defined in the template. The resource will be created.
87
+
88
+
-**Delete**: This change type only applies when using [complete mode](deployment-modes.md) for deployment. The resource exists, but isn't defined in the template. With complete mode, the resource will be deleted. Only resources that [support complete mode deletion](complete-mode-deletion.md) are included in this change type.
89
+
90
+
-**Ignore**: The resource exists, but isn't defined in the template. The resource won't be deployed or modified.
91
+
92
+
-**NoChange**: The resource exists, and is defined in the template. The resource will be redeployed, but the properties of the resource won't change. This change type is returned when [ResultFormat](#result-format) is set to `FullResourcePayloads`, which is the default value.
93
+
94
+
-**Modify**: The resource exists, and is defined in the template. The resource will be redeployed, and the properties of the resource will change. This change type is returned when [ResultFormat](#result-format) is set to `FullResourcePayloads`, which is the default value.
95
+
96
+
-**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`.
97
+
69
98
## Result format
70
99
71
-
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`.
100
+
You can control the level of detail that is returned about the predicted changes. In the deployment commands (`New-Az*Deployment`), use the **-WhatIfResultFormat** parameter. In the programmatic object commands (`Get-Az*DeploymentWhatIf`), use the **ResultFormat** parameter.
101
+
102
+
Set the format 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`.
72
103
73
104
The following results show the two different output formats:
74
105
@@ -77,17 +108,27 @@ The following results show the two different output formats:
77
108
```powershell
78
109
Resource and property changes are indicated with these symbols:
0 commit comments