Skip to content

Commit d56c3c7

Browse files
committed
new tabs article + change redirects
1 parent a8b64c1 commit d56c3c7

7 files changed

+229
-253
lines changed

.openpublishing.redirection.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3729,16 +3729,6 @@
37293729
"source_path_from_root": "/articles/virtual-network/tutorial-create-route-table-cli.md",
37303730
"redirect_url": "/azure/virtual-network/tutorial-create-route-table",
37313731
"redirect_document_id": false
3732-
},
3733-
{
3734-
"source_path_from_root": "/articles/virtual-network/ip-services/virtual-networks-static-private-ip-arm-cli.md",
3735-
"redirect_url": "/azure/virtual-network/ip-services/virtual-networks-static-private-ip-arm-pportal",
3736-
"redirect_document_id": false
3737-
},
3738-
{
3739-
"source_path_from_root": "/articles/virtual-network/ip-services/virtual-networks-static-private-ip-arm-ps.md",
3740-
"redirect_url": "/azure/virtual-network/ip-services/virtual-networks-static-private-ip-arm-pportal",
3741-
"redirect_document_id": false
37423732
}
37433733
]
37443734
}

articles/virtual-network/.openpublishing.redirection.virtual-network.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,26 @@
11991199
"source_path_from_root": "/articles/virtual-network/virtual-network-service-endpoint-policies-powershell.md",
12001200
"redirect_url": "/azure/virtual-network/virtual-network-service-endpoint-policies",
12011201
"redirect_document_id": false
1202+
},
1203+
{
1204+
"source_path_from_root": "/articles/virtual-network/ip-services/virtual-networks-static-private-ip-arm-cli.md",
1205+
"redirect_url": "/azure/virtual-network/ip-services/virtual-networks-static-private-ip-arm-pportal",
1206+
"redirect_document_id": false
1207+
},
1208+
{
1209+
"source_path_from_root": "/articles/virtual-network/ip-services/virtual-networks-static-private-ip-arm-ps.md",
1210+
"redirect_url": "/azure/virtual-network/ip-services/virtual-networks-static-private-ip-arm-pportal",
1211+
"redirect_document_id": false
1212+
},
1213+
{
1214+
"source_path_from_root": "/articles/virtual-network/ip-services/virtual-network-deploy-static-pip-arm-ps.md",
1215+
"redirect_url": "/azure/virtual-network/ip-services/virtual-network-deploy-static-pip-arm-portal",
1216+
"redirect_document_id": false
1217+
},
1218+
{
1219+
"source_path_from_root": "/articles/virtual-network/ip-services/virtual-network-deploy-static-pip-arm-cli.md",
1220+
"redirect_url": "/azure/virtual-network/ip-services/virtual-network-deploy-static-pip-arm-portal",
1221+
"redirect_document_id": false
12021222
}
12031223
]
12041224
}

articles/virtual-network/ip-services/virtual-network-deploy-static-pip-arm-cli.md

Lines changed: 0 additions & 98 deletions
This file was deleted.

articles/virtual-network/ip-services/virtual-network-deploy-static-pip-arm-portal.md

Lines changed: 173 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,35 @@
22
title: Create a VM with a static public IP address - Azure portal
33
description: Learn how to create a VM with a static public IP address using the Azure portal.
44
services: virtual-network
5-
ms.date: 08/24/2023
5+
ms.date: 11/14/2024
66
ms.author: mbender
77
author: mbender-ms
88
ms.service: azure-virtual-network
99
ms.subservice: ip-services
1010
ms.topic: how-to
11-
ms.custom: template-how-to, engagement-fy23
11+
ms.custom: template-how-to
1212
---
1313
# Create a virtual machine with a static public IP address using the Azure portal
1414

15-
In this article, you'll create a virtual machine (VM) with a static public IP address. A public IP address enables you to communicate to a VM from the internet. Assign a static public IP address, rather than a dynamic address, to ensure the address never changes.
15+
In this article, you create a virtual machine (VM) with a static public IP address. A public IP address enables you to communicate to a VM from the internet. Assign a static public IP address, rather than a dynamic address, to ensure the address never changes.
1616

1717
Public IP addresses have a [nominal charge](https://azure.microsoft.com/pricing/details/ip-addresses). There's a [limit](../../azure-resource-manager/management/azure-subscription-service-limits.md?toc=%2fazure%2fvirtual-network%2ftoc.json#azure-resource-manager-virtual-networking-limits) to the number of public IP addresses that you can use per subscription.
1818

1919
You can download the list of ranges (prefixes) for the Azure [Public](https://www.microsoft.com/download/details.aspx?id=56519), [US government](https://www.microsoft.com/download/details.aspx?id=57063), [China](https://www.microsoft.com/download/details.aspx?id=57062), and [Germany](https://www.microsoft.com/download/details.aspx?id=57064) clouds.
2020

21-
## Prerequisites
21+
[!INCLUDE [ip-services-prerequisites](../../../includes/ip-services-prerequisites.md)]
2222

23-
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
23+
## Create a virtual machine with a static public IP address
2424

25-
## Sign in to Azure
25+
In this section, you create a virtual machine with a static public IP address using the Azure portal, Azure PowerShell, or Azure CLI. Along with the virtual machine, you create a public IP address and the other required resources.
26+
27+
# [Azure portal](#tab/azureportal)
28+
29+
### Sign in to Azure
2630

2731
Sign in to the [Azure portal](https://portal.azure.com).
2832

29-
## Create a virtual machine
33+
### Create a virtual machine
3034

3135
1. In the search box at the top of the portal, enter *Virtual machine*.
3236

@@ -40,7 +44,7 @@ Sign in to the [Azure portal](https://portal.azure.com).
4044
| ------- | ------ |
4145
| **Project Details** | |
4246
| Subscription | Select your Azure subscription |
43-
| Resource Group | Select **Create new**. </br> In **Name**, enter *myResourceGroup*. </br> Select **OK**. |
47+
| Resource Group | Select **Create new**.</br> In **Name**, enter *myResourceGroup*.</br> Select **OK**. |
4448
| **Instance details** | |
4549
| Virtual machine name | Enter *myVM*. |
4650
| Region | Select **East US**. |
@@ -56,7 +60,7 @@ Sign in to the [Azure portal](https://portal.azure.com).
5660
| Select inbound ports | Select **RDP (3389)**. |
5761

5862
> [!WARNING]
59-
> Port 3389 is selected to enable remote access to the Windows Server virtual machine from the internet. Opening port 3389 to the internet is not recommended to manage production workloads. </br> For secure access to Azure virtual machines, see **[What is Azure Bastion?](../../bastion/bastion-overview.md)**
63+
> Port 3389 is selected to enable remote access to the Windows Server virtual machine from the internet. Opening port 3389 to the internet is not recommended to manage production workloads.</br> For secure access to Azure virtual machines, see **[What is Azure Bastion?](../../bastion/bastion-overview.md)**
6064
6165
5. Select the **Networking** tab, or select **Next: Disks**, then **Next: Networking**.
6266

@@ -67,7 +71,7 @@ Sign in to the [Azure portal](https://portal.azure.com).
6771
| **Network interface** | |
6872
| Virtual network | Accept the default network name. |
6973
| Subnet | Accept the default subnet configuration. |
70-
| Public IP | Select **Create new**. </br> In **Create public IP address**, enter *myPublicIP* in **Name** . </br> **SKU**: select **Standard**. </br> **Assignment**: select **Static**. </br> Select **OK**. |
74+
| Public IP | Select **Create new**.</br> In **Create public IP address**, enter *myPublicIP* in **Name**.</br> **SKU**: select **Standard**.</br> **Assignment**: select **Static**.</br> Select **OK**. |
7175
| NIC network security group | Select **Basic** |
7276
| Public inbound ports | Select **Allow selected ports**. |
7377
| Select inbound ports | Select **RDP (3389)** |
@@ -84,16 +88,174 @@ Sign in to the [Azure portal](https://portal.azure.com).
8488
8589
[!INCLUDE [ephemeral-ip-note.md](~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md)]
8690

91+
# [Azure PowerShell](#tab/azurepowershell)
92+
93+
### Create a resource group
94+
95+
An Azure resource group is a logical container into which Azure resources are deployed and managed.
96+
97+
Create a resource group with [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) named **myResourceGroup** in the **eastus2** location.
98+
99+
```azurepowershell-interactive
100+
$rg =@{
101+
Name = 'myResourceGroup'
102+
Location = 'eastus2'
103+
}
104+
New-AzResourceGroup @rg
105+
106+
```
107+
108+
### Create a public IP address
109+
110+
Use [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress) to create a standard public IPv4 address.
111+
112+
The following command creates a zone-redundant public IP address named **myPublicIP** in **myResourceGroup**.
113+
114+
```azurepowershell-interactive
115+
## Create IP. ##
116+
$ip = @{
117+
Name = 'myPublicIP'
118+
ResourceGroupName = 'myResourceGroup'
119+
Location = 'eastus2'
120+
Sku = 'Standard'
121+
AllocationMethod = 'Static'
122+
IpAddressVersion = 'IPv4'
123+
Zone = 1,2,3
124+
}
125+
New-AzPublicIpAddress @ip
126+
```
127+
### Create a virtual machine
128+
129+
Create a virtual machine with [New-AzVM](/powershell/module/az.Compute/new-azvm).
130+
131+
The following command creates a Windows Server virtual machine. You enter the name of the public IP address created previously in the **`-PublicIPAddressName`** parameter. When prompted, provide a username and password to be used as the credentials for the virtual machine:
132+
133+
```azurepowershell-interactive
134+
## Create virtual machine. ##
135+
$vm = @{
136+
ResourceGroupName = 'myResourceGroup'
137+
Location = 'East US 2'
138+
Name = 'myVM'
139+
PublicIpAddressName = 'myPublicIP'
140+
}
141+
New-AzVM @vm
142+
```
143+
144+
For more information on public IP SKUs, see [Public IP address SKUs](public-ip-addresses.md#sku). A virtual machine can be added to the backend pool of an Azure Load Balancer. The SKU of the public IP address must match the SKU of a load balancer's public IP. For more information, see [Azure Load Balancer](../../load-balancer/skus.md).
145+
146+
View the public IP address assigned and confirm that it was created as a static address, with [Get-AzPublicIpAddress](/powershell/module/az.network/get-azpublicipaddress):
147+
148+
```azurepowershell-interactive
149+
## Retrieve public IP address settings. ##
150+
$ip = @{
151+
Name = 'myPublicIP'
152+
ResourceGroupName = 'myResourceGroup'
153+
}
154+
Get-AzPublicIpAddress @ip | Select "IpAddress","PublicIpAllocationMethod" | Format-Table
155+
156+
```
157+
158+
> [!WARNING]
159+
> Do not modify the IP address settings within the virtual machine's operating system. The operating system is unaware of Azure public IP addresses. Though you can add private IP address settings to the operating system, we recommend not doing so unless necessary, and not until after reading [Add a private IP address to an operating system](virtual-network-network-interface-addresses.md#private).
160+
161+
[!INCLUDE [ephemeral-ip-note.md](~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md)]
162+
163+
164+
# [Azure CLI](#tab/azurecli)
165+
166+
### Create a resource group
167+
168+
An Azure resource group is a logical container into which Azure resources are deployed and managed.
169+
170+
Create a resource group with [az group create](/cli/azure/group#az-group-create) named **myResourceGroup** in the **eastus2** location.
171+
172+
```azurecli-interactive
173+
az group create \
174+
--name myResourceGroup \
175+
--location eastus2
176+
```
177+
178+
### Create a public IP address
179+
180+
Use [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create) to create a standard public IPv4 address.
181+
182+
The following command creates a zone-redundant public IP address named **myPublicIP** in **myResourceGroup**.
183+
184+
```azurecli-interactive
185+
az network public-ip create \
186+
--resource-group myResourceGroup \
187+
--name myPublicIP \
188+
--version IPv4 \
189+
--sku Standard \
190+
--zone 1 2 3
191+
```
192+
### Create a virtual machine
193+
194+
Create a virtual machine with [az vm create](/cli/azure/vm#az-vm-create).
195+
196+
The following command creates a Windows Server virtual machine. You enter the name of the public IP address created previously in the **`-PublicIPAddressName`** parameter. When prompted, provide a username and password to be used as the credentials for the virtual machine:
197+
198+
```azurecli-interactive
199+
az vm create \
200+
--name myVM \
201+
--resource-group TutorVMRoutePref-rg \
202+
--public-ip-address myPublicIP \
203+
--size Standard_A2 \
204+
--image MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest \
205+
--admin-username azureuser
206+
```
207+
208+
For more information on public IP SKUs, see [Public IP address SKUs](public-ip-addresses.md#sku). A virtual machine can be added to the backend pool of an Azure Load Balancer. The SKU of the public IP address must match the SKU of a load balancer's public IP. For more information, see [Azure Load Balancer](../../load-balancer/skus.md).
209+
210+
View the public IP address assigned and confirm that it was created as a static address, with [az network public-ip show](/cli/azure/network/public-ip#az-network-public-ip-show):
211+
212+
```azurecli-interactive
213+
az network public-ip show \
214+
--resource-group myResourceGroup \
215+
--name myPublicIP \
216+
--query [ipAddress,publicIpAllocationMethod,sku] \
217+
--output table
218+
```
219+
220+
> [!WARNING]
221+
> Do not modify the IP address settings within the virtual machine's operating system. The operating system is unaware of Azure public IP addresses. Though you can add private IP address settings to the operating system, we recommend not doing so unless necessary, and not until after reading [Add a private IP address to an operating system](virtual-network-network-interface-addresses.md#private).
222+
223+
[!INCLUDE [ephemeral-ip-note.md](~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md)]
224+
225+
---
226+
227+
87228
## Clean up resources
88229

89-
When no longer needed, delete the resource group and all of the resources it contains:
230+
When resources are no longer needed, delete all resources created in this article to avoid incurring charges.
231+
232+
# [Azure portal](#tab/azureportal)
233+
234+
Use the Azure portal to delete the resource group and all of the resources it contains:
90235

91236
1. Enter *myResourceGroup* in the search box at the top of the portal. When you see **myResourceGroup** in the search results, select it.
92237

93238
2. Select **Delete resource group**.
94239

95240
3. Enter *myResourceGroup* for **TYPE THE RESOURCE GROUP NAME:** and select **Delete**.
96241

242+
# [Azure PowerShell](#tab/azurepowershell)
243+
244+
Use [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) to remove the resource group and all of the resources it contains:
245+
246+
```azurepowershell-interactive
247+
Remove-AzResourceGroup -Name myResourceGroup -Force
248+
```
249+
250+
# [Azure CLI](#tab/azurecli)
251+
252+
Use [az group delete](/cli/azure/group#az-group-delete) to remove the resource group and all of the resources it contains:
253+
254+
```azurecli-interactive
255+
az group delete --name myResourceGroup --yes
256+
```
257+
---
258+
97259
## Next steps
98260

99261
In this article, you learned how to create a VM with a static public IP.

0 commit comments

Comments
 (0)