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/ip-services/virtual-networks-static-private-ip-arm-pportal.md
+39-4Lines changed: 39 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: 'Create a VM with a static private IP address - Azure portal'
3
-
description: Learn how to create a virtual machine with a static private IP address using the Azure portal.
4
-
ms.date: 08/24/2023
2
+
title: 'Create a VM with a static private IP address'
3
+
description: Learn to create a virtual machine with a static private IP address using the Azure portal, Azure PowerShell, or Azure CLI.
4
+
ms.date: 11/19/2024
5
5
ms.author: mbender
6
6
author: mbender-ms
7
7
ms.service: azure-virtual-network
@@ -10,14 +10,34 @@ ms.topic: how-to
10
10
ms.custom: template-how-to, engagement-fy23
11
11
---
12
12
13
-
# Create a virtual machine with a static private IP address using the Azure portal
13
+
# Create a virtual machine with a static private IP address
14
14
15
15
When you create a virtual machine (VM), it's automatically assigned a private IP address from a range that you specify. This IP address is based on the subnet in which the VM is deployed, and the VM keeps this address until the VM is deleted. Azure dynamically assigns the next available private IP address from the subnet you create a VM in. If you want to assign a specific IP address in this subnet for your VM, use a static IP address.
16
16
17
17
## Prerequisites
18
18
19
+
# [Azure portal](#tab/azureportal)
20
+
19
21
- An Azure account with an active subscription. You can [create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
20
22
23
+
# [Azure PowerShell](#tab/azurepowershell)
24
+
25
+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
26
+
- Azure PowerShell installed locally or Azure Cloud Shell
27
+
28
+
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-azure-powershell). If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
In this procedure, you change the private IP address from **dynamic** to **static** for the VM you created previously:
66
92
@@ -92,7 +118,13 @@ In this procedure, you change the private IP address from **dynamic** to **stati
92
118
>
93
119
>If you manually set the private IP address within the operating system, make sure it matches the private IP address assigned to the Azure [network interface](virtual-network-network-interface-addresses.md#change-ip-address-settings). Otherwise, you can lose connectivity to the VM. For more information, see [private IP address settings](virtual-network-network-interface-addresses.md#private).
94
120
121
+
# [Azure PowerShell](#tab/azurepowershell)
122
+
# [Azure CLI](#tab/azurecli)
123
+
124
+
---
125
+
95
126
## Clean up resources
127
+
# [Azure portal](#tab/azureportal)
96
128
97
129
When you're finished, delete the resource group and all of the resources it contains:
98
130
@@ -101,7 +133,10 @@ When you're finished, delete the resource group and all of the resources it cont
101
133
1. From the **myResourceGroup** screen, select **Delete resource group**.
102
134
103
135
1. Enter *myResourceGroup* for **Enter resource group name to confirm deletion**, and then select **Delete**.
136
+
# [Azure PowerShell](#tab/azurepowershell)
137
+
# [Azure CLI](#tab/azurecli)
104
138
139
+
---
105
140
## Next steps
106
141
107
142
- Learn more about [static public IP addresses](public-ip-addresses.md#ip-address-assignment) in Azure.
0 commit comments