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/virtual-network/nat-gateway/quickstart-create-nat-gateway-template.md
+80-41Lines changed: 80 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,11 @@
2
2
title: 'Create a NAT gateway - Resource Manager Template'
3
3
titleSuffix: Azure NAT Gateway
4
4
description: This quickstart shows how to create a NAT gateway by using the Azure Resource Manager template (ARM template).
5
-
services: nat-gateway
6
5
author: asudbring
7
-
manager: KumudD
8
6
ms.service: virtual-network
7
+
ms.subservice: nat
9
8
ms.topic: how-to
10
-
ms.workload: infrastructure-services
11
-
ms.date: 10/27/2020
9
+
ms.date: 04/24/2023
12
10
ms.author: allensu
13
11
ms.custom: subject-armqs, devx-track-arm-template
14
12
# 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 (
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.
24
22
25
23
[](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)
26
24
27
25
## Prerequisites
28
26
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)
30
28
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.
- 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
+
---
31
52
## Review the template
32
53
33
54
The template used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/nat-gateway-1-vm).
34
55
35
56
This template is configured to create a:
36
57
37
58
* Virtual network
59
+
38
60
* NAT gateway resource
61
+
39
62
* Ubuntu virtual machine
40
63
41
64
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
45
68
Nine Azure resources are defined in the template:
46
69
47
70
***[Microsoft.Network/networkSecurityGroups](/azure/templates/microsoft.network/networksecuritygroups)**: Creates a network security group.
71
+
48
72
***[Microsoft.Network/networkSecurityGroups/securityRules](/azure/templates/microsoft.network/networksecuritygroups/securityrules)**: Creates a security rule.
73
+
49
74
***[Microsoft.Network/publicIPAddresses](/azure/templates/microsoft.network/publicipaddresses)**: Creates a public IP address.
75
+
50
76
***[Microsoft.Network/publicIPPrefixes](/azure/templates/microsoft.network/publicipprefixes)**: Creates a public IP prefix.
77
+
51
78
***[Microsoft.Compute/virtualMachines](/azure/templates/Microsoft.Compute/virtualMachines)**: Creates a virtual machine.
79
+
52
80
***[Microsoft.Network/virtualNetworks](/azure/templates/microsoft.network/virtualnetworks)**: Creates a virtual network.
81
+
53
82
***[Microsoft.Network/natGateways](/azure/templates/microsoft.network/natgateways)**: Creates a NAT gateway resource.
83
+
54
84
***[Microsoft.Network/virtualNetworks/subnets](/azure/templates/microsoft.network/virtualnetworks/subnets)**: Creates a virtual network subnet.
85
+
55
86
***[Microsoft.Network/networkinterfaces](/azure/templates/microsoft.network/networkinterfaces)**: Creates a network interface.
56
87
57
88
## Deploy the template
58
89
59
-
**Azure CLI**
90
+
# [**Portal**](#tab/create-nat-portal)
60
91
61
-
```azurecli-interactive
62
-
read -p "Enter the location (i.e. westcentralus): " location
[](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)
65
93
66
-
az group create \
67
-
--name $resourceGroupName \
68
-
--location $location
94
+
## Review deployed resources
69
95
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:
[](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)
92
119
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
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)
108
139
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**.
113
141
114
-
**Azure PowerShell**
142
+
# [**PowerShell**](#tab/create-nat-powershell)
115
143
116
144
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.
117
145
118
146
```azurepowershell-interactive
119
147
Remove-AzResourceGroup -Name myResourceGroupNAT
120
148
```
121
149
122
-
**Azure portal**
150
+
# [**Azure CLI**](#tab/create-nat-cli)
123
151
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
+
---
125
160
126
161
## Next steps
127
162
128
163
In this quickstart, you created a:
129
164
130
165
* NAT gateway resource
166
+
131
167
* Virtual network
168
+
132
169
* Ubuntu virtual machine
133
170
134
171
The virtual machine is deployed to a virtual network subnet associated with the NAT gateway.
135
172
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.
137
174
138
175
* Read an [Overview of Azure NAT Gateway](nat-overview.md)
176
+
139
177
* Read about the [NAT Gateway resource](nat-gateway-resource.md)
178
+
140
179
* Learn more about [Azure Resource Manager](../../azure-resource-manager/management/overview.md)
0 commit comments