Skip to content

Commit 63551fa

Browse files
Merge pull request #268981 from asudbring/encrypt-how-to-posh
Added section to articles on how to enable encryption on an existing VNET
2 parents 9da52b7 + 3682ba9 commit 63551fa

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

articles/virtual-network/how-to-create-encryption-cli.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ Use [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create) to
5252
--subnet-prefixes 10.0.0.0/24
5353
```
5454

55+
## Enable on existing virtual network
56+
57+
You can also enable encryption on an existing virtual network using [az network vnet update](/cli/azure/network/vnet#az-network-vnet-update).
58+
59+
```azurecli-interactive
60+
az network vnet update \
61+
--resource-group test-rg \
62+
--name vnet-1 \
63+
--enable-encryption true \
64+
--encryption-enforcement-policy allowUnencrypted
65+
```
66+
5567
> [!IMPORTANT]
5668
> Azure Virtual Network encryption requires supported virtual machine SKUs in the virtual network for traffic to be encrypted. For more information, see [Azure Virtual Network encryption requirements](virtual-network-encryption-overview.md#requirements).
5769

articles/virtual-network/how-to-create-encryption-portal.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Azure Virtual Network encryption is a feature of Azure Virtual Network. Virtual
2525
2626
## Enable encryption
2727

28+
Use the following steps to enable encryption for a virtual network.
29+
2830
1. In the search box at the top of the portal, begin typing **Virtual networks**. When **Virtual networks** appears in the search results, select it.
2931

3032
1. Select **vnet-1**.

articles/virtual-network/how-to-create-encryption-powershell.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ New-AzVirtualNetwork @net
6868
6969
```
7070

71+
## Enable on existing virtual network
72+
73+
You can also enable encryption on an existing virtual network using [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork).
74+
75+
```azurepowershell-interactive
76+
## Place the virtual network configuration into a variable. ##
77+
$net = @{
78+
Name = 'vnet-1'
79+
ResourceGroupName = 'test-rg'
80+
}
81+
$vnet = Get-AzVirtualNetwork @net
82+
83+
## Enable encryption on the virtual network ##
84+
$vnet.Encryption = @{
85+
Enabled = 'true'
86+
Enforcement = 'allowUnencrypted'
87+
}
88+
$vnet | Set-AzVirtualNetwork
89+
```
90+
7191
> [!IMPORTANT]
7292
> Azure Virtual Network encryption requires supported virtual machine SKUs in the virtual network for traffic to be encrypted. For more information, see [Azure Virtual Network encryption requirements](virtual-network-encryption-overview.md#requirements).
7393

0 commit comments

Comments
 (0)