Skip to content

Commit 1a7c501

Browse files
authored
Merge pull request #203012 from AbdullahBell/QSVirtualNetworkManagerPowerShell
Quickstart: Create a mesh network with Azure Virtual Network Manager using Azure PowerShell | Freshness Update
2 parents 323c2f5 + 5afa4e9 commit 1a7c501

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: mbender-ms
55
ms.author: mbender
66
ms.service: virtual-network-manager
77
ms.topic: quickstart
8-
ms.date: 11/02/2021
8+
ms.date: 06/27/2022
99
ms.custom: template-quickstart, ignite-fall-2021, mode-api
1010
---
1111

@@ -27,15 +27,7 @@ In this quickstart, you'll deploy three virtual networks and use Azure Virtual N
2727
* If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
2828

2929
> [!IMPORTANT]
30-
> Perform this quickstart using Powershell localy, not through Azure Cloud Shell. The version of `Az.Network` in Azure Cloud Shell does not currently support the Azure Virtual Network Manager cmdlets.
31-
32-
## Register subscription for public preview
33-
34-
Use the following command to register your Azure subscription for Public Preview of Azure Virtual Network Manager:
35-
36-
```azurepowershell-interactive
37-
Register-AzProviderFeature -FeatureName AllowAzureNetworkManager -ProviderNamespace Microsoft.Network
38-
```
30+
> Perform this quickstart 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.
3931
4032
## Install Azure PowerShell module
4133

@@ -67,7 +59,7 @@ New-AzResourceGroup @rg
6759
[System.Collections.Generic.List[string]]$subGroup = @()
6860
$subGroup.Add("/subscriptions/abcdef12-3456-7890-abcd-ef1234567890")
6961
[System.Collections.Generic.List[string]]$mgGroup = @()
70-
$mgGroup.Add("/managementGroups/abcdef12-3456-7890-abcd-ef1234567890")
62+
$mgGroup.Add("/providers/Microsoft.Management/managementGroups/abcdef12-3456-7890-abcd-ef1234567890")
7163
7264
[System.Collections.Generic.List[String]]$access = @()
7365
$access.Add("Connectivity");
@@ -156,14 +148,26 @@ $virtualnetworkC | Set-AzVirtualNetwork
156148
1. Create a static virtual network member with New-AzNetworkManagerGroupMembersItem.
157149

158150
```azurepowershell-interactive
159-
$member = New-AzNetworkManagerGroupMembersItem –ResourceId "/subscriptions/abcdef12-3456-7890-abcd-ef1234567890/resourceGroups/myAVNMResourceGroup/providers/Microsoft.Network/virtualNetworks/VNetA"
151+
$ng = @{
152+
Name = 'myNetworkGroup'
153+
ResourceGroupName = 'myAVNMResourceGroup'
154+
NetworkManagerName = 'myAVNM'
155+
MemberType = 'Microsoft.Network/VirtualNetwork'
156+
}
157+
$networkgroup = New-AzNetworkManagerGroup @ng
160158
```
161-
159+
162160
1. Add the static member to the static membership group with the following commands:
163161
164162
```azurepowershell-interactive
165-
[System.Collections.Generic.List[Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerGroupMembersItem]]$groupMembers = @()
166-
$groupMembers.Add($member)
163+
$sm = @{
164+
Name = 'myStaticMember'
165+
ResourceGroupName = 'myAVNMResourceGroup'
166+
NetworkGroupName = 'myNetworkGroup'
167+
NetworkManagerName = 'myAVNM'
168+
ResourceId = '/subscriptions/abcdef12-3456-7890-abcd-ef1234567890/resourceGroups/myAVNMResourceGroup/providers/Microsoft.Network/virtualNetworks/VNetA'
169+
}
170+
$statimember = New-AzNetworkManagerStaticMember @sm
167171
```
168172
169173
### Dynamic membership

0 commit comments

Comments
 (0)