Skip to content

Commit a2fdaf5

Browse files
authored
Merge pull request #293014 from mbender-ms/avnm-qs-updates
virtual network manager | Major Updates & Freshness | Quickstarts
2 parents 936655b + e32bf69 commit a2fdaf5

18 files changed

+200
-319
lines changed

articles/virtual-network-manager/create-virtual-network-manager-cli.md

Lines changed: 84 additions & 167 deletions
Large diffs are not rendered by default.

articles/virtual-network-manager/create-virtual-network-manager-portal.md

Lines changed: 55 additions & 90 deletions
Large diffs are not rendered by default.

articles/virtual-network-manager/create-virtual-network-manager-powershell.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: mbender-ms
55
ms.author: mbender
66
ms.service: azure-virtual-network-manager
77
ms.topic: quickstart
8-
ms.date: 10/22/2024
8+
ms.date: 1/13/2024
99
ms.custom: template-quickstart, mode-api, engagement-fy23, devx-track-azurepowershell
1010
---
1111

@@ -20,8 +20,8 @@ In this quickstart, you deploy three virtual networks and use Azure Virtual Netw
2020
## Prerequisites
2121

2222
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
23-
- Perform this quickstart by using PowerShell locally, not through Azure Cloud Shell. The version of *Az.Network* in Azure Cloud Shell does not currently support the Azure Virtual Network Manager cmdlets.
24-
- To modify dynamic network groups, you must be [granted access via Azure RBAC role](concept-network-groups.md#network-groups-and-azure-policy) assignment only. Classic Admin/legacy authorization is not supported.
23+
- Perform this quickstart by using PowerShell locally, not through Azure Cloud Shell. The version of *Az.Network* in Azure Cloud Shell doesn't currently support the Azure Virtual Network Manager cmdlets.
24+
- To modify dynamic network groups, you must be [granted access via Azure RBAC role](concept-network-groups.md#network-groups-and-azure-policy) assignment only. Classic Admin/legacy authorization isn't supported.
2525

2626
## Sign in to your Azure account and select your subscription
2727

@@ -47,11 +47,11 @@ Install the latest *Az.Network* Azure PowerShell module by using this command:
4747

4848
## Create a resource group
4949

50-
Before you can create an Azure Virtual Network Manager instance, you have to create a resource group to host it. Create a resource group by using [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup). This example creates a resource group named *resource-group* in the *West US 2* region:
50+
In this task, create a resource group to host a network manager instance. Create a resource group by using [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup). This example creates a resource group named *resource-group* in the *West US 2* region:
5151

5252
```azurepowershell
5353
# Create a resource group
54-
$location = "West US 2"
54+
$location = "westus2"
5555
$rg = @{
5656
Name = 'resource-group'
5757
Location = $location
@@ -62,10 +62,10 @@ New-AzResourceGroup @rg
6262

6363
## Define the scope and access type
6464

65-
Define the scope and access type for the Azure Virtual Network Manager instance by using [New-AzNetworkManagerScope](/powershell/module/az.network/new-aznetworkmanagerscope). This example defines a scope with a single subscription and sets the access type to *Connectivity*. Replace `<subscription_id>` with the ID of the subscription that you want to manage through Azure Virtual Network Manager.
65+
In this task, define the scope and access type for the Azure Virtual Network Manager instance by using [New-AzNetworkManagerScope](/powershell/module/az.network/new-aznetworkmanagerscope). This example defines a scope with a single subscription and sets the access type to *Connectivity*. Replace `<subscription_id>` with the ID of the subscription that you want to manage through Azure Virtual Network Manager.
6666

6767
```azurepowershell
68-
$subID= <subscription_id>
68+
$subID= "<subscription_id>"
6969
7070
[System.Collections.Generic.List[string]]$subGroup = @()
7171
$subGroup.Add("/subscriptions/$subID")
@@ -79,12 +79,12 @@ $scope = New-AzNetworkManagerScope -Subscription $subGroup
7979

8080
## Create a Virtual Network Manager instance
8181

82-
Create a Virtual Network Manager instance by using [New-AzNetworkManager](/powershell/module/az.network/new-aznetworkmanager). This example creates an instance named *network-manager* in the *West US 2* region:
82+
In this task, create a Virtual Network Manager instance by using [New-AzNetworkManager](/powershell/module/az.network/new-aznetworkmanager). This example creates an instance named *network-manager* in the *(US) West US 2* region:
8383

8484
```azurepowershell
8585
$avnm = @{
8686
Name = 'network-manager'
87-
ResourceGroupName = $rg.ResourceGroupName
87+
ResourceGroupName = $rg.Name
8888
NetworkManagerScope = $scope
8989
NetworkManagerScopeAccess = $access
9090
Location = $location
@@ -94,81 +94,81 @@ $networkmanager = New-AzNetworkManager @avnm
9494

9595
## Create three virtual networks
9696

97-
Create three virtual networks by using [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork). This example creates virtual networks named *vnet-spoke-001*, *vnet-spoke-002*, and *vnet-hub-001* in the *West US 2* region. If you already have virtual networks that you want create a mesh network with, you can skip to the next section.
97+
In this task, create three virtual networks by using [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork). This example creates virtual networks named *vnet-00*, *vnet-01*, and *vnet-02* in the *(US) West US 2* region. If you already have virtual networks that you want create a mesh network with, you can skip to the next section.
9898

9999
```azurepowershell
100-
$vnetspoke001 = @{
101-
Name = 'vnet-spoke-001'
102-
ResourceGroupName = $rg.ResourceGroupName
100+
$vnet_00 = @{
101+
Name = 'vnet-00'
102+
ResourceGroupName = $rg.Name
103103
Location = $location
104104
AddressPrefix = '10.0.0.0/16'
105105
}
106106
107-
$vnet_spoke_001 = New-AzVirtualNetwork @vnetspoke001
107+
$vnet_00 = New-AzVirtualNetwork @vnet_00
108108
109-
$vnetspoke002 = @{
110-
Name = 'vnet-spoke-002'
111-
ResourceGroupName = $rg.ResourceGroupName
109+
$vnet_01 = @{
110+
Name = 'vnet-01'
111+
ResourceGroupName = $rg.Name
112112
Location = $location
113113
AddressPrefix = '10.1.0.0/16'
114114
}
115-
$vnet_spoke_002 = New-AzVirtualNetwork @vnetspoke002
115+
$vnet_01 = New-AzVirtualNetwork @vnet_01
116116
117-
$vnethub001 = @{
118-
Name = 'vnet-hub-001'
119-
ResourceGroupName = $rg.ResourceGroupName
117+
$vnet_02 = @{
118+
Name = 'vnet-02'
119+
ResourceGroupName = $rg.Name
120120
Location = $location
121121
AddressPrefix = '10.2.0.0/16'
122122
}
123-
$vnet_hub_001 = New-AzVirtualNetwork @vnethub001
123+
$vnet_02 = New-AzVirtualNetwork @vnet_02
124124
```
125125

126126
### Add a subnet to each virtual network
127127

128-
To complete the configuration of the virtual networks, create a subnet configuration named *default* with a subnet address prefix of */24* by using [Add-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/add-azvirtualnetworksubnetconfig). Then, use [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork) to apply the subnet configuration to the virtual network.
128+
In this task, create a subnet configuration named *default* with a subnet address prefix of */24* by using [Add-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/add-azvirtualnetworksubnetconfig). Then, use [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork) to apply the subnet configuration to the virtual network.
129129

130130
```azurepowershell
131-
$subnet_vnetspoke001 = @{
131+
$subnet_vnet_00 = @{
132132
Name = 'default'
133-
VirtualNetwork = $vnet_spoke_001
133+
VirtualNetwork = $vnet_00
134134
AddressPrefix = '10.0.0.0/24'
135135
}
136-
$subnetConfig_vnetspoke001 = Add-AzVirtualNetworkSubnetConfig @subnet_vnetspoke001
137-
$vnet_spoke_001 | Set-AzVirtualNetwork
136+
$subnetConfig_vnet_00 = Add-AzVirtualNetworkSubnetConfig @subnet_vnet_00
137+
$vnet_00 | Set-AzVirtualNetwork
138138
139-
$subnet_vnetspoke002 = @{
139+
$subnet_vnet_01 = @{
140140
Name = 'default'
141-
VirtualNetwork = $vnet_spoke_002
141+
VirtualNetwork = $vnet_01
142142
AddressPrefix = '10.1.0.0/24'
143143
}
144-
$subnetConfig_vnetspoke002 = Add-AzVirtualNetworkSubnetConfig @subnet_vnetspoke002
145-
$vnet_spoke_002 | Set-AzVirtualNetwork
144+
$subnetConfig_vnet_01 = Add-AzVirtualNetworkSubnetConfig @subnet_vnet_01
145+
$vnet_01 | Set-AzVirtualNetwork
146146
147-
$subnet_vnet_hub_001 = @{
147+
$subnet_vnet_02 = @{
148148
Name = 'default'
149-
VirtualNetwork = $vnet_hub_001
149+
VirtualNetwork = $vnet_02
150150
AddressPrefix = '10.2.0.0/24'
151151
}
152-
$subnetConfig_vnet_hub_001 = Add-AzVirtualNetworkSubnetConfig @subnet_vnet_hub_001
153-
$vnet_hub_001 | Set-AzVirtualNetwork
152+
$subnetConfig_vnet_02 = Add-AzVirtualNetworkSubnetConfig @subnet_vnet_02
153+
$vnet_02 | Set-AzVirtualNetwork
154154
```
155155

156156
## Create a network group
157157

158-
Virtual Network Manager applies configurations to groups of virtual networks by placing them in network groups. Create a network group by using [New-AzNetworkManagerGroup](/powershell/module/az.network/new-aznetworkmanagergroup). This example creates a network group named *network-group* in the West US 2 region:
158+
Virtual Network Manager applies configurations to groups of virtual networks by placing them in network groups. Create a network group by using [New-AzNetworkManagerGroup](/powershell/module/az.network/new-aznetworkmanagergroup). This example creates a network group named *network-group* in the *(US) West US 2* region:
159159

160160
```azurepowershell
161161
$ng = @{
162162
Name = 'network-group'
163-
ResourceGroupName = $rg.ResourceGroupName
163+
ResourceGroupName = $rg.Name
164164
NetworkManagerName = $networkManager.Name
165165
}
166166
$ng = New-AzNetworkManagerGroup @ng
167167
```
168168

169169
## Define membership for a mesh configuration
170170

171-
In this task, you add the static members *vnet-spoke-001* and *vnet-spoke-002* to the network group *network-group* by using [New-AzNetworkManagerStaticMember](/powershell/module/az.network/new-aznetworkmanagerstaticmember).
171+
In this task, you add the static members *vnet-00* and *vnet-01* to the network group *network-group* by using [New-AzNetworkManagerStaticMember](/powershell/module/az.network/new-aznetworkmanagerstaticmember).
172172

173173
Static members must have a unique name that's scoped to the network group. We recommend that you use a consistent hash of the virtual network ID. This approach uses the Azure Resource Manager template's `uniqueString()` implementation.
174174

@@ -181,25 +181,25 @@ Static members must have a unique name that's scoped to the network group. We re
181181
```
182182

183183
```azurepowershell
184-
$sm_vnetspoke001 = @{
185-
Name = Get-UniqueString $vnet_spoke_001.Id
186-
ResourceGroupName = $rg.ResourceGroupName
184+
$sm_vnet_00 = @{
185+
Name = Get-UniqueString $vnet_00.Id
186+
ResourceGroupName = $rg.Name
187187
NetworkGroupName = $ng.Name
188188
NetworkManagerName = $networkManager.Name
189-
ResourceId = $vnet_spoke_001.Id
189+
ResourceId = $vnet_00.Id
190190
}
191-
$sm_vnetspoke001 = New-AzNetworkManagerStaticMember @sm_vnetspoke001
191+
$sm_vnet_00 = New-AzNetworkManagerStaticMember @sm_vnet_00
192192
```
193193

194194
```azurepowershell
195-
$sm_vnetspoke002 = @{
196-
Name = Get-UniqueString $vnet_spoke_002.Id
197-
ResourceGroupName = $rg.ResourceGroupName
195+
$sm_vnet_01 = @{
196+
Name = Get-UniqueString $vnet_01.Id
197+
ResourceGroupName = $rg.Name
198198
NetworkGroupName = $ng.Name
199199
NetworkManagerName = $networkManager.Name
200-
ResourceId = $vnet_spoke_002.Id
200+
ResourceId = $vnet_01.Id
201201
}
202-
$sm_vnetspoke002 = New-AzNetworkManagerStaticMember @sm_vnetspoke002
202+
$sm_vnet_01 = New-AzNetworkManagerStaticMember @sm_vnet_01
203203
```
204204

205205
## Create a connectivity configuration
@@ -227,7 +227,7 @@ In this task, you create a connectivity configuration with the network group *ne
227227
```azurepowershell
228228
$config = @{
229229
Name = 'connectivity-configuration'
230-
ResourceGroupName = $rg.ResourceGroupName
230+
ResourceGroupName = $rg.Name
231231
NetworkManagerName = $networkManager.Name
232232
ConnectivityTopology = 'Mesh'
233233
AppliesToGroup = $configGroup
@@ -247,7 +247,7 @@ $target.Add("westus2")
247247
248248
$deployment = @{
249249
Name = $networkManager.Name
250-
ResourceGroupName = $rg.ResourceGroupName
250+
ResourceGroupName = $rg.Name
251251
ConfigurationId = $configIds
252252
TargetLocation = $target
253253
CommitType = 'Connectivity'
@@ -257,17 +257,18 @@ Deploy-AzNetworkManagerCommit @deployment
257257

258258
## Clean up resources
259259

260-
If you no longer need the Azure Virtual Network Manager instance and it's associate resources, delete the resource group that contains them. Deleting the resource group also deletes the resources that you created.
260+
If you no longer need the Azure Virtual Network Manager instance and its resources, follow these steps to delete them by deleting the resource group containing the resources:
261261

262262
1. Delete the resource group using [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup):
263263

264264
```azurepowershell
265-
Remove-AzResourceGroup -Name $rg.ResourceGroupName -Force
265+
Remove-AzResourceGroup -Name $rg.Name -Force
266266
```
267267
268268
## Next steps
269269
270-
Now that you've created an Azure Virtual Network Manager instance, learn how to block network traffic by using a security admin configuration:
270+
In this step, learn how to block network traffic by using a security admin configuration:
271271
272272
> [!div class="nextstepaction"]
273273
> [Block network traffic with Azure Virtual Network Manager](how-to-block-network-traffic-powershell.md)
274+
8.09 KB
Loading
39.8 KB
Loading
17 KB
Loading
-7.33 KB
Loading
129 KB
Loading

0 commit comments

Comments
 (0)