Skip to content

Commit 1009946

Browse files
authored
Merge pull request #235671 from asudbring/linux-fixes-1
[Doc-a-thon] Linux doc-athon fixes for Create a NAT gateway - Template
2 parents 2791835 + 63c2dcc commit 1009946

File tree

1 file changed

+80
-41
lines changed

1 file changed

+80
-41
lines changed

articles/virtual-network/nat-gateway/quickstart-create-nat-gateway-template.md

Lines changed: 80 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
title: 'Create a NAT gateway - Resource Manager Template'
33
titleSuffix: Azure NAT Gateway
44
description: This quickstart shows how to create a NAT gateway by using the Azure Resource Manager template (ARM template).
5-
services: nat-gateway
65
author: asudbring
7-
manager: KumudD
86
ms.service: virtual-network
7+
ms.subservice: nat
98
ms.topic: how-to
10-
ms.workload: infrastructure-services
11-
ms.date: 10/27/2020
9+
ms.date: 04/24/2023
1210
ms.author: allensu
1311
ms.custom: subject-armqs, devx-track-arm-template
1412
# Customer intent: I want to create a NAT gateway by using an Azure Resource Manager template so that I can provide outbound connectivity for my virtual machines.
@@ -20,22 +18,47 @@ Get started with Azure NAT Gateway by using an Azure Resource Manager template (
2018

2119
[!INCLUDE [About Azure Resource Manager](../../../includes/resource-manager-quickstart-introduction.md)]
2220

23-
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template will open in the Azure portal.
21+
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template opens in the Azure portal.
2422

2523
[![Deploy to Azure](../../media/template-deployments/deploy-to-azure.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.network%2Fnat-gateway-1-vm%2Fazuredeploy.json)
2624

2725
## Prerequisites
2826

29-
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
27+
# [**Portal**](#tab/create-nat-portal)
3028

29+
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
30+
31+
# [**PowerShell**](#tab/create-nat-powershell)
32+
33+
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
34+
35+
- Azure PowerShell installed locally or Azure Cloud Shell.
36+
37+
- Sign in to Azure PowerShell and ensure you've selected the subscription with which you want to use this feature. For more information, see [Sign in with Azure PowerShell](/powershell/azure/authenticate-azureps).
38+
39+
- Ensure your `Az.Network` module is 4.3.0 or later. To verify the installed module, use the command `Get-InstalledModule -Name "Az.Network"`. If the module requires an update, use the command `Update-Module -Name Az.Network` if necessary.
40+
41+
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 5.4.1 or later. Run `Get-Module -ListAvailable Az` to find the installed version. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-Az-ps). If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
42+
43+
# [**Azure CLI**](#tab/create-nat-cli)
44+
45+
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
46+
47+
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
48+
49+
- This how-to article requires version 2.31.0 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
50+
51+
---
3152
## Review the template
3253

3354
The template used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/nat-gateway-1-vm).
3455

3556
This template is configured to create a:
3657

3758
* Virtual network
59+
3860
* NAT gateway resource
61+
3962
* Ubuntu virtual machine
4063

4164
The Ubuntu VM is deployed to a subnet that's associated with the NAT gateway resource.
@@ -45,34 +68,42 @@ The Ubuntu VM is deployed to a subnet that's associated with the NAT gateway res
4568
Nine Azure resources are defined in the template:
4669

4770
* **[Microsoft.Network/networkSecurityGroups](/azure/templates/microsoft.network/networksecuritygroups)**: Creates a network security group.
71+
4872
* **[Microsoft.Network/networkSecurityGroups/securityRules](/azure/templates/microsoft.network/networksecuritygroups/securityrules)**: Creates a security rule.
73+
4974
* **[Microsoft.Network/publicIPAddresses](/azure/templates/microsoft.network/publicipaddresses)**: Creates a public IP address.
75+
5076
* **[Microsoft.Network/publicIPPrefixes](/azure/templates/microsoft.network/publicipprefixes)**: Creates a public IP prefix.
77+
5178
* **[Microsoft.Compute/virtualMachines](/azure/templates/Microsoft.Compute/virtualMachines)**: Creates a virtual machine.
79+
5280
* **[Microsoft.Network/virtualNetworks](/azure/templates/microsoft.network/virtualnetworks)**: Creates a virtual network.
81+
5382
* **[Microsoft.Network/natGateways](/azure/templates/microsoft.network/natgateways)**: Creates a NAT gateway resource.
83+
5484
* **[Microsoft.Network/virtualNetworks/subnets](/azure/templates/microsoft.network/virtualnetworks/subnets)**: Creates a virtual network subnet.
85+
5586
* **[Microsoft.Network/networkinterfaces](/azure/templates/microsoft.network/networkinterfaces)**: Creates a network interface.
5687

5788
## Deploy the template
5889

59-
**Azure CLI**
90+
# [**Portal**](#tab/create-nat-portal)
6091

61-
```azurecli-interactive
62-
read -p "Enter the location (i.e. westcentralus): " location
63-
resourceGroupName="myResourceGroupNAT"
64-
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/nat-gateway-1-vm/azuredeploy.json"
92+
[![Deploy to Azure](../../media/template-deployments/deploy-to-azure.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.network%2Fnat-gateway-1-vm%2Fazuredeploy.json)
6593

66-
az group create \
67-
--name $resourceGroupName \
68-
--location $location
94+
## Review deployed resources
6995

70-
az deployment group create \
71-
--resource-group $resourceGroupName \
72-
--template-uri $templateUri
73-
```
96+
1. Sign in to the [Azure portal](https://portal.azure.com).
97+
98+
1. Select **Resource groups** from the left pane.
99+
100+
1. Select the resource group that you created in the previous section. The default resource group name is **myResourceGroupNAT**
101+
102+
1. Verify the following resources were created in the resource group:
103+
104+
![Virtual Network NAT resource group](./media/quick-create-template/nat-gateway-template-rg.png)
74105

75-
**Azure PowerShell**
106+
# [**PowerShell**](#tab/create-nat-powershell)
76107

77108
```azurepowershell-interactive
78109
$location = Read-Host -Prompt "Enter the location (i.e. westcentralus)"
@@ -84,57 +115,65 @@ New-AzResourceGroup -Name $resourceGroupName -Location $location
84115
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri
85116
```
86117

87-
**Azure portal**
88-
89-
[![Deploy to Azure](../../media/template-deployments/deploy-to-azure.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.network%2Fnat-gateway-1-vm%2Fazuredeploy.json)
90-
91-
## Review deployed resources
118+
# [**Azure CLI**](#tab/create-nat-cli)
92119

93-
1. Sign in to the [Azure portal](https://portal.azure.com).
94-
95-
1. Select **Resource groups** from the left pane.
120+
```azurecli-interactive
121+
read -p "Enter the location (i.e. westcentralus): " location
122+
resourceGroupName="myResourceGroupNAT"
123+
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/nat-gateway-1-vm/azuredeploy.json"
96124
97-
1. Select the resource group that you created in the previous section. The default resource group name is **myResourceGroupNAT**
125+
az group create \
126+
--name $resourceGroupName \
127+
--location $location
98128
99-
1. Verify the following resources were created in the resource group:
129+
az deployment group create \
130+
--resource-group $resourceGroupName \
131+
--template-uri $templateUri
132+
```
100133

101-
![Virtual Network NAT resource group](./media/quick-create-template/nat-gateway-template-rg.png)
134+
---
102135

103136
## Clean up resources
104137

105-
**Azure CLI**
106-
107-
When no longer needed, you can use the [az group delete](/cli/azure/group#az-group-delete) command to remove the resource group and all resources contained within.
138+
# [**Portal**](#tab/create-nat-portal)
108139

109-
```azurecli-interactive
110-
az group delete \
111-
--name myResourceGroupNAT
112-
```
140+
When no longer needed, delete the resource group, NAT gateway, and all related resources. Select the resource group **myResourceGroupNAT** that contains the NAT gateway, and then select **Delete**.
113141

114-
**Azure PowerShell**
142+
# [**PowerShell**](#tab/create-nat-powershell)
115143

116144
When no longer needed, you can use the [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) command to remove the resource group and all resources contained within.
117145

118146
```azurepowershell-interactive
119147
Remove-AzResourceGroup -Name myResourceGroupNAT
120148
```
121149

122-
**Azure portal**
150+
# [**Azure CLI**](#tab/create-nat-cli)
123151

124-
When no longer needed, delete the resource group, NAT gateway, and all related resources. Select the resource group **myResourceGroupNAT** that contains the NAT gateway, and then select **Delete**.
152+
When no longer needed, you can use the [az group delete](/cli/azure/group#az-group-delete) command to remove the resource group and all resources contained within.
153+
154+
```azurecli-interactive
155+
az group delete \
156+
--name myResourceGroupNAT
157+
```
158+
159+
---
125160

126161
## Next steps
127162

128163
In this quickstart, you created a:
129164

130165
* NAT gateway resource
166+
131167
* Virtual network
168+
132169
* Ubuntu virtual machine
133170

134171
The virtual machine is deployed to a virtual network subnet associated with the NAT gateway.
135172

136-
To learn more about Azure NAT Gateway and Azure Resource Manager, continue to the articles below.
173+
To learn more about Azure NAT Gateway and Azure Resource Manager, continue to the following articles.
137174

138175
* Read an [Overview of Azure NAT Gateway](nat-overview.md)
176+
139177
* Read about the [NAT Gateway resource](nat-gateway-resource.md)
178+
140179
* Learn more about [Azure Resource Manager](../../azure-resource-manager/management/overview.md)

0 commit comments

Comments
 (0)