Skip to content

Commit e8635b1

Browse files
committed
Update article with tabs
1 parent cd67eaf commit e8635b1

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

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

Lines changed: 19 additions & 5 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: 08/24/2023
8+
ms.date: 11/19/2024
99
ms.service: azure-virtual-network
1010
ms.subservice: ip-services
1111
ms.topic: how-to
@@ -16,13 +16,17 @@ 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](#azure-portal), the [Azure CLI](#azure-cli), or [Azure PowerShell](#powershell) to dissociate a public IP address from a VM.
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)
2023

2124
## Prerequisites
2225

2326
- 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.
2428

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

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

3741
:::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.":::
3842

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

4147
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.
4248

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

51+
## Dissociate a public IP address from a VM
52+
4553
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.
4654

4755
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*.
@@ -97,12 +105,16 @@ az network nic ip-config update \
97105
98106
In the previous example, *myVMPublicIP* is the name of the public IP address.
99107
100-
## PowerShell
108+
109+
110+
## Pre-requisites
101111
102112
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.
103113
104114
- If using PowerShell locally, sign in to Azure with `Connect-AzAccount`.
105115
116+
# [Azure PowerShell](#tab/azurepowershell/)
117+
106118
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.
107119
108120
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*.
@@ -158,6 +170,8 @@ Set-AzNetworkInterface -NetworkInterface $nic
158170
159171
In the previous example, *myVMPublicIP* is the name of the public IP address.
160172
173+
---
174+
161175
## Next steps
162176
163177
In this article, you learned how to dissociate a public IP address from a virtual machine.

0 commit comments

Comments
 (0)