Skip to content

Commit 68a748a

Browse files
committed
updates
1 parent e8635b1 commit 68a748a

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

articles/virtual-network/ip-services/remove-public-ip-address-vm.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to dissociate a public IP address from an Azure virtual m
55
services: virtual-network
66
author: mbender-ms
77
ms.author: mbender
8-
ms.date: 11/19/2024
8+
ms.date: 08/24/2023
99
ms.service: azure-virtual-network
1010
ms.subservice: ip-services
1111
ms.topic: how-to
@@ -16,17 +16,13 @@ ms.custom: template-how-to, engagement-fy23, devx-track-azurepowershell, devx-tr
1616

1717
In this article, you learn how to dissociate a public IP address from an Azure virtual machine (VM). Removing the public IP address of your VM will also remove its ability to connect to the internet.
1818

19-
You can use the Azure portal, the Azure CLI, or Azure PowerShell to dissociate a public IP address from a VM.
20-
21-
22-
# [Azure portal](#tab/azureportal)
19+
You can use the [Azure portal](#azure-portal), the [Azure CLI](#azure-cli), or [Azure PowerShell](#powershell) to dissociate a public IP address from a VM.
2320

2421
## Prerequisites
2522

2623
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
27-
- A virtual machine with a public IP address associated to it.
2824

29-
## Dissociate a public IP address from a VM
25+
## Azure portal
3026

3127
1. Sign in to the [Azure portal](https://portal.azure.com).
3228
2. Browse to, or search for the virtual machine that you want to disassociate the public IP address from and then select it.
@@ -40,16 +36,12 @@ You can use the Azure portal, the Azure CLI, or Azure PowerShell to dissociate a
4036

4137
:::image type="content" source="./media/remove-public-ip-address-vm/dissociate-public-ip.png" alt-text="Screenshot of the Overview page of a public IP address resource showing how to dissociate it from the network interface of a virtual machine.":::
4238

43-
# [Azure CLI](#tab/azurecli/)
44-
45-
## Prerequisites
39+
## Azure CLI
4640

4741
Install the [Azure CLI](/cli/azure/install-azure-cli), or use the [Azure Cloud Shell](../../cloud-shell/overview.md). The Azure Cloud Shell is a free shell that you can run directly within the Azure portal. It has the Azure CLI preinstalled and configured to use with your account.
4842

4943
- If using the CLI locally in Bash, sign in to Azure with `az login`.
5044

51-
## Dissociate a public IP address from a VM
52-
5345
A public IP address is associated to an IP configuration of a network interface attached to a VM. Use the [az network nic-ip-config update](/cli/azure/network/nic/ip-config#az-network-nic-ip-config-update) command to dissociate a public IP address from an IP configuration.
5446

5547
The following example dissociates a public IP address named *myVMPublicIP* from an IP configuration named *ipconfigmyVM* of an existing network interface named *myVMNic* that is attached to a VM named *myVM* in a resource group named *myResourceGroup*.
@@ -105,16 +97,12 @@ az network nic ip-config update \
10597
10698
In the previous example, *myVMPublicIP* is the name of the public IP address.
10799
108-
109-
110-
## Pre-requisites
100+
## PowerShell
111101
112102
Install [PowerShell](/powershell/azure/install-azure-powershell), or use the [Azure Cloud Shell](../../cloud-shell/overview.md). The Azure Cloud Shell is a free shell that you can run directly within the Azure portal. It has PowerShell preinstalled and configured to use with your account.
113103
114104
- If using PowerShell locally, sign in to Azure with `Connect-AzAccount`.
115105
116-
# [Azure PowerShell](#tab/azurepowershell/)
117-
118106
A public IP address is associated to an IP configuration of a network interface attached to a VM. Use the [Get-AzNetworkInterface](/powershell/module/Az.Network/Get-AzNetworkInterface) command to get a network interface. Set the Public IP address value to null and then use the [Set-AzNetworkInterface](/powershell/module/Az.Network/Set-AzNetworkInterface) command to write the new IP configuration to the network interface.
119107
120108
The following example dissociates a public IP address named *myVMPublicIP* from a network interface named *myVMNic* that is attached to a VM named *myVM*. All resources are in a resource group named *myResourceGroup*.
@@ -169,9 +157,6 @@ Set-AzNetworkInterface -NetworkInterface $nic
169157
```
170158
171159
In the previous example, *myVMPublicIP* is the name of the public IP address.
172-
173-
---
174-
175160
## Next steps
176161
177162
In this article, you learned how to dissociate a public IP address from a virtual machine.
@@ -180,4 +165,4 @@ In this article, you learned how to dissociate a public IP address from a virtua
180165
181166
- Learn how to [associate a public IP address to a VM](./associate-public-ip-address-vm.md).
182167
183-
- Learn how to [configure IP addresses for an Azure network interface](./virtual-network-network-interface-addresses.md).
168+
- Learn how to [configure IP addresses for an Azure network interface](./virtual-network-network-interface-addresses.md).

0 commit comments

Comments
 (0)