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
Manual configuration steps in the Azure portal (no wizard)
70
70
71
-
* Using PowerShell, the following script takes the names of the Resource Group and Virtual Network and loops through each subnet to enable private subnet.
71
+
1. Open the **Azure portal**.
72
+
2. Go to **Virtual networks**.
73
+
3. Select the virtual network that contains the subnet you want to modify.
74
+
4. In the left menu, select **Subnets**.
75
+
5. Select the subnet you want to make private.
76
+
6. Locate the **Default outbound access** setting.
77
+
7. Set **Default outbound access** to **Disabled**.
78
+
8. Select **Save**.
72
79
80
+
This explicitly sets the subnet property:
81
+
82
+
```text
83
+
defaultOutboundAccess = false
73
84
```
85
+
which prevents Azure from assigning default outbound public IPs to virtual machines in this subnet.
86
+
87
+
> [!IMPORTANT]
88
+
> Existing virtual machines must be **stopped and deallocated** for this change to take effect on their network interfaces.
89
+
90
+
# [PowerShell](#tab/powershell)
91
+
92
+
The following script takes the names of the Resource Group and Virtual Network and loops through each subnet to enable private subnet.
93
+
94
+
```powershell
74
95
$resourceGroupName = ""
75
96
$vnetName = ""
76
97
@@ -89,15 +110,19 @@ foreach ($subnet in $vnet.Subnets) {
89
110
Set-AzVirtualNetwork -VirtualNetwork $vnet
90
111
```
91
112
92
-
* Using CLI, update the subnet with [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) and set `--default-outbound` to "false"
113
+
# [Azure CLI](#tab/azurecli)
93
114
94
-
```
115
+
Update the subnet with [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) and set `--default-outbound` to "false"
0 commit comments