Skip to content

Commit 2c7179a

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into freshness_c59
2 parents 0e17509 + 509ffab commit 2c7179a

File tree

2 files changed

+101
-17
lines changed

2 files changed

+101
-17
lines changed

articles/azure-resource-manager/templates/template-deploy-what-if.md

Lines changed: 92 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@ title: Template deployment what-if (Preview)
33
description: Determine what changes will happen to your resources before deploying an Azure Resource Manager template.
44
author: mumian
55
ms.topic: conceptual
6-
ms.date: 04/27/2020
6+
ms.date: 04/28/2020
77
ms.author: jgao
88
---
99
# ARM template deployment what-if operation (Preview)
1010

11-
Before deploying an Azure Resource Manager (ARM) template, you might want to preview the changes that will happen. Azure Resource Manager provides the what-if operation to let you see how resources will change if you deploy the template. The what-if operation doesn't make any changes to existing resources. Instead, it predicts the changes if the specified template is deployed.
11+
Before deploying an Azure Resource Manager (ARM) template, you can preview the changes that will happen. Azure Resource Manager provides the what-if operation to let you see how resources will change if you deploy the template. The what-if operation doesn't make any changes to existing resources. Instead, it predicts the changes if the specified template is deployed.
1212

1313
> [!NOTE]
1414
> The what-if operation is currently in preview. 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).
1515
16-
You can use the what-if operation with the PowerShell commands or REST API operations.
16+
You can use the what-if operation with Azure PowerShell, Azure CLI, or REST API operations.
1717

1818
## Install PowerShell module
1919

20-
To use what-if in PowerShell, you must have PowerShell Core (6.x or 7.x). If you have PowerShell 5.x or earlier, [update your version of PowerShell](/powershell/scripting/install/installing-powershell).
21-
22-
After making sure you have the correct version of PowerShell, install a preview version of the Az.Resources module from the PowerShell gallery.
20+
To use what-if in PowerShell, you must install a preview version of the Az.Resources module from the PowerShell gallery. But, before installing the module, make sure you have PowerShell Core (6.x or 7.x). If you have PowerShell 5.x or earlier, [update your version of PowerShell](/powershell/scripting/install/installing-powershell). You can't install the preview module on PowerShell 5.x or earlier.
2321

2422
### Install preview version
2523

@@ -54,9 +52,13 @@ If you previously installed an alpha version of the what-if module, uninstall th
5452

5553
You're ready to use what-if.
5654

55+
## Install Azure CLI module
56+
57+
To use what-if in Azure CLI, you must have Azure CLI 2.5.0 or later. If needed, [install the latest version of Azure CLI](/cli/azure/install-azure-cli).
58+
5759
## See results
5860

59-
In PowerShell, the output includes color-coded results that help you see the different types of changes.
61+
When you use what-if in PowerShell or Azure CLI, the output includes color-coded results that help you see the different types of changes.
6062

6163
![Resource Manager template deployment what-if operation fullresourcepayload and change types](./media/template-deploy-what-if/resource-manager-deployment-whatif-change-types.png)
6264

@@ -91,11 +93,9 @@ Resource changes: 1 to modify.
9193

9294
## What-if commands
9395

94-
You can use either Azure PowerShell or Azure REST API for the what-if operation.
95-
9696
### Azure PowerShell
9797

98-
To see a preview of the changes before deploying a template, add the `-Whatif` switch parameter to the deployment command.
98+
To preview changes before deploying a template, add the `-Whatif` switch parameter to the deployment command.
9999

100100
* `New-AzResourceGroupDeployment -Whatif` for resource group deployments
101101
* `New-AzSubscriptionDeployment -Whatif` and `New-AzDeployment -Whatif` for subscription level deployments
@@ -110,6 +110,23 @@ The preceding commands return a text summary that you can manually inspect. To g
110110
* `$results = Get-AzResourceGroupDeploymentWhatIfResult` for resource group deployments
111111
* `$results = Get-AzSubscriptionDeploymentWhatIfResult` or `$results = Get-AzDeploymentWhatIfResult` for subscription level deployments
112112

113+
### Azure CLI
114+
115+
To preview changes before deploying a template, use `what-if` with the deployment command.
116+
117+
* `az deployment group what-if` for resource group deployments
118+
* `az deployment sub what-if` for subscription level deployments
119+
120+
Or, you can use the `--confirm-with-what-if` parameter to preview the changes and get prompted to continue with the deployment.
121+
122+
* `az deployment group create --confirm-with-what-if` for resource group deployments
123+
* `az deployment sub create --confirm-with-what-if` for subscription level deployments
124+
125+
The preceding commands return a text summary that you can manually inspect. To get a JSON object that you can programmatically inspect for changes, use:
126+
127+
* `az deployment group what-if --no-pretty-print` for resource group deployments
128+
* `az deployment sub what-if --no-pretty-print` for subscription level deployments
129+
113130
### Azure REST API
114131

115132
For REST API, use:
@@ -135,10 +152,17 @@ The what-if operation lists six different types of changes:
135152

136153
## Result format
137154

138-
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.
155+
You control the level of detail that is returned about the predicted changes. You have two options:
156+
157+
* **FullResourcePayloads** - returns a list of resources that will change and details about the properties that will change
158+
* **ResourceIdOnly** - returns a list of resources that will change
159+
160+
The default value is **FullResourcePayloads**.
139161

140-
Set the format parameter to **FullResourcePayloads** to get a list of resources that will change and details about the properties that will change. Set the format parameter to **ResourceIdOnly** to get a list of resources that will change. The default value is **FullResourcePayloads**.
162+
For PowerShell deployment commands, use the `-WhatIfResultFormat` parameter. In the programmatic object commands, use the `ResultFormat` parameter.
141163

164+
For Azure CLI, use the `--result-format` parameter.
165+
142166
The following results show the two different output formats:
143167

144168
- Full resource payloads
@@ -191,6 +215,8 @@ The following results show the two different output formats:
191215

192216
To see how what-if works, let's runs some tests. First, deploy a [template that creates a virtual network](https://github.com/Azure/azure-docs-json-samples/blob/master/azure-resource-manager/what-if/what-if-before.json). You'll use this virtual network to test how changes are reported by what-if.
193217

218+
# [PowerShell](#tab/azure-powershell)
219+
194220
```azurepowershell
195221
New-AzResourceGroup `
196222
-Name ExampleGroup `
@@ -200,9 +226,24 @@ New-AzResourceGroupDeployment `
200226
-TemplateUri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/what-if/what-if-before.json"
201227
```
202228

229+
# [Azure CLI](#tab/azure-cli)
230+
231+
```azurecli
232+
az group create \
233+
--name ExampleGroup \
234+
--location "Central US"
235+
az deployment group create \
236+
--resource-group ExampleGroup \
237+
--template-uri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/what-if/what-if-before.json"
238+
```
239+
240+
---
241+
203242
### Test modification
204243

205-
After the deployment completes, you're ready to test the what-if operation. This time deploy a [template that changes the virtual network](https://github.com/Azure/azure-docs-json-samples/blob/master/azure-resource-manager/what-if/what-if-after.json). It's missing one the original tags, a subnet has been removed, and the address prefix has changed.
244+
After the deployment completes, you're ready to test the what-if operation. This time you deploy a [template that changes the virtual network](https://github.com/Azure/azure-docs-json-samples/blob/master/azure-resource-manager/what-if/what-if-after.json). It's missing one the original tags, a subnet has been removed, and the address prefix has changed.
245+
246+
# [PowerShell](#tab/azure-powershell)
206247

207248
```azurepowershell
208249
New-AzResourceGroupDeployment `
@@ -211,6 +252,16 @@ New-AzResourceGroupDeployment `
211252
-TemplateUri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/what-if/what-if-after.json"
212253
```
213254

255+
# [Azure CLI](#tab/azure-cli)
256+
257+
```azurecli
258+
az deployment group what-if \
259+
--resource-group ExampleGroup \
260+
--template-uri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/what-if/what-if-after.json"
261+
```
262+
263+
---
264+
214265
The what-if output appears similar to:
215266

216267
![Resource Manager template deployment what-if operation output](./media/template-deploy-what-if/resource-manager-deployment-whatif-change-types.png)
@@ -254,6 +305,8 @@ Some of the properties that are listed as deleted won't actually change. Propert
254305

255306
Now, let's programmatically evaluate the what-if results by setting the command to a variable.
256307

308+
# [PowerShell](#tab/azure-powershell)
309+
257310
```azurepowershell
258311
$results = Get-AzResourceGroupDeploymentWhatIfResult `
259312
-ResourceGroupName ExampleGroup `
@@ -269,20 +322,42 @@ foreach ($change in $results.Changes)
269322
}
270323
```
271324

325+
# [Azure CLI](#tab/azure-cli)
326+
327+
```azurecli
328+
results=$(az deployment group what-if --resource-group ExampleGroup --template-uri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/what-if/what-if-after.json" --no-pretty-print)
329+
```
330+
331+
---
332+
272333
## Confirm deletion
273334

274335
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.
275336

276337
To preview changes before deploying a template, use the `-Confirm` switch parameter with the deployment command. If the changes are as you expected, confirm that you want the deployment to complete.
277338

339+
# [PowerShell](#tab/azure-powershell)
340+
278341
```azurepowershell
279342
New-AzResourceGroupDeployment `
280-
-Confirm `
281343
-ResourceGroupName ExampleGroup `
282-
-TemplateUri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/empty-template/azuredeploy.json" `
283-
-Mode Complete
344+
-Mode Complete `
345+
-Confirm `
346+
-TemplateUri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/empty-template/azuredeploy.json"
284347
```
285348

349+
# [Azure CLI](#tab/azure-cli)
350+
351+
```azurecli
352+
az deployment group create \
353+
--resource-group ExampleGroup \
354+
--mode Complete \
355+
--confirm-with-what-if \
356+
--template-uri "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/empty-template/azuredeploy.json"
357+
```
358+
359+
---
360+
286361
Because no resources are defined in the template and the deployment mode is set to complete, the virtual network will be deleted.
287362

288363
![Resource Manager template deployment what-if operation output deployment mode complete](./media/template-deploy-what-if/resource-manager-deployment-whatif-output-mode-complete.png)
@@ -320,4 +395,5 @@ You see the expected changes and can confirm that you want the deployment to run
320395

321396
- 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).
322397
- To deploy templates with Azure PowerShell, see [Deploy resources with ARM templates and Azure PowerShell](deploy-powershell.md).
398+
- To deploy templates with Azure CLI, see [Deploy resources with ARM templates and Azure CLI](deploy-cli.md).
323399
- To deploy templates with REST, see [Deploy resources with ARM templates and Resource Manager REST API](deploy-rest.md).

articles/virtual-network/troubleshoot-nat.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.devlang: na
1212
ms.topic: overview
1313
ms.tgt_pltfrm: na
1414
ms.workload: infrastructure-services
15-
ms.date: 03/30/2020
15+
ms.date: 04/28/2020
1616
ms.author: allensu
1717
---
1818

@@ -96,6 +96,7 @@ The following table can be used a starting point for which tools to use to start
9696

9797
Connectivity issues with [Virtual Network NAT](nat-overview.md) can be caused by several different issues:
9898

99+
* permanent failures due to configuration mistakes.
99100
* transient or persistent [SNAT exhaustion](#snat-exhaustion) of the NAT gateway,
100101
* transient failures in the Azure infrastructure,
101102
* transient failures in the path between Azure and the public Internet destination,
@@ -108,6 +109,13 @@ Use tools like the following to validation connectivity. [ICMP ping isn't suppor
108109
| Linux | nc (generic connection test) | curl (TCP application layer test) | application specific |
109110
| Windows | [PsPing](https://docs.microsoft.com/sysinternals/downloads/psping) | PowerShell [Invoke-WebRequest](https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest) | application specific |
110111

112+
#### Configuration
113+
114+
Check the following:
115+
1. Does the NAT gateway resource have at least one public IP resource or one public IP prefix resource? You must at least have one IP address associated with the NAT gateway for it to be able to provide outbound connectivity.
116+
2. Is the virtual network's subnet configured to use the NAT gateway?
117+
3. Are you using UDR (user-defined route) and are you overriding the destination? NAT gateway resources become the default route (0/0) on configured subnets.
118+
111119
#### SNAT exhaustion
112120

113121
Review section on [SNAT exhaustion](#snat-exhaustion) in this article.

0 commit comments

Comments
 (0)