Skip to content

Commit da2bb3b

Browse files
author
Michael Bender
committed
Article and TOC - Moved
1 parent 253b51c commit da2bb3b

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

articles/virtual-network-manager/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
items:
7878
- name: Configure cross-tenant connection - Portal
7979
href: how-to-configure-cross-tenant-portal.md
80+
- name: Configure cross-tenant connection - CLI
81+
href: how-to-configure-cross-tenant-cli.md
8082
- name: View applied configurations
8183
href: how-to-view-applied-configurations.md
8284
- name: Define dynamic network group membership with Azure Policy
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Configure cross-tenant connection in Azure Virtual Network Manager - CLI
3+
description: Learn to connect Azure subscriptions in Azure Virtual Network Manager using cross-tenant connections for the management of virtual networks across subscriptions.
4+
author: mbender-ms
5+
ms.author: mbender
6+
ms.service: virtual-network-manager
7+
ms.topic: how-to
8+
ms.date: 11/1/2022
9+
ms.custom: template-how-to
10+
#customerintent: As a cloud admin, in need to manage multi tenants from a single network manager instance. Cross tenant functionality will give me this so I can easily manage all network resources governed by azure virtual network manager
11+
---
12+
13+
# Configure cross-tenant connection in Azure Virtual Network Manager
14+
15+
In this article, you’ll learn how-to create cross-tenant connections in Azure Virtual Network Manager using [Azure CLI](/cli/azure/network/manager/scope-connection). Cross-tenant support allows organizations to use a central Network Manager instance for managing virtual networks across different tenants and subscriptions. First, you'll create the scope connection on the central network manager. Then you'll create the network manager connection on the connecting tenant, and verify connection. Last, you'll add virtual networks from different tenants and verify. Once completed, You can centrally manage the resources of other tenants from a central network manager instance.
16+
17+
> [!IMPORTANT]
18+
> Azure Virtual Network Manager is currently in public preview.
19+
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
20+
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
21+
## Prerequisites
22+
23+
- Two Azure tenants with virtual networks needing to be managed by Azure Virtual Network Manager Deploy. During the how-to, the tenants will be referred to as follows:
24+
- **Central management tenant** - The tenant where an Azure Virtual Network Manager instance is installed, and you'll centrally manage network groups from cross-tenant connections.
25+
- **Target managed tenant** - The tenant containing virtual networks to be managed. This tenant will be connected to the central management tenant.
26+
- Azure Virtual Network Manager deployed in the central management tenant.
27+
- Required permissions include:
28+
- Administrator of central management tenant has guest account in target managed tenant.
29+
- Administrator guest account has *Network Contributor* permissions applied at appropriate scope level(Management group, subscription, or virtual network).
30+
31+
Need help with setting up permissions? Check out how to [add guest users in the Azure portal](../active-directory/external-identities/b2b-quickstart-add-guest-users-portal.md), and how to [assign user roles to resources in Azure portal](../role-based-access-control/role-assignments-portal.md)
32+
## Create scope connection within network manager
33+
34+
Creation of the scope connection begins on the central management tenant with a network manager deployed, which is the network manager where you plan to manage all of your resources across tenants. In this task, you'll set up a scope connection to add a subscription from a target tenant. If you wish to use a management group, you'll modify the `–resource-id` argument to look like `/providers/Microsoft.Management/managementGroups/{mgId}`.
35+
36+
```azurecli
37+
# Create scope connection in network manager in the central management tenant
38+
az network manager scope-connection create --resource-group "myRG" --network-manager-name "myAVNM" --name "ToTargetManagedTenant" --description "This is a connection to manage resources in the target managed tenant" --resource-id "/subscriptions/6a5f35e9-6951-499d-a36b-83c6c6eed44a" --tenant-id "72f988bf-86f1-41af-91ab-2d7cd011db47"
39+
```
40+
41+
## Create network manager connection on subscription in other tenant
42+
Once the scope connection is created, you'll switch to your target tenant for the network manager connection. During this task, you'll connect the target tenant to the scope connection created previously and verify the connection state.
43+
44+
1. Enter the following command to connect to the target managed tenant with your administrative account:
45+
46+
```azurecli
47+
48+
# Login to target managed tenant
49+
# Note: Change the --tenant value to the appropriate tenant ID
50+
az login --tenant "79686033-97a2-4ebd-8e7d-0cae2c7df00e"
51+
```
52+
You'll be required to complete authentication with your organization based on your organizations policies.
53+
54+
1. Enter the following
55+
Set the subscription (note it’s the same as the one the connection references in step 1)
56+
```azurecli
57+
# Set the Azure subscription
58+
az account set --subscription dec492d3-4f4e-493b-aa47-7bdf2f96a6fc
59+
60+
# Create cross-tenant connection to central management tenant
61+
az network manager connection subscription create --connection-name "toCentralManagementTenant" --description "This connection allows management of the tenant by a central management tenant" --network-manager-id "/subscriptions/6a5f35e9-6951-499d-a36b-83c6c6eed44a/resourceGroups/myRG/providers/Microsoft.Network/networkManagers/myAVNM"
62+
```
63+
64+
## Verify the connection state
65+
66+
1. Enter the following command to check the connection Status:
67+
```azurecli
68+
# Check connection status
69+
az network manager connection subscription show --name "toCentralManagementTenant"
70+
```
71+
72+
Switch back to the Contoso tenant, and performing a get on the network manager shows the subscription added via the cross tenant scopes property.
73+
74+
```azurecli
75+
# View subscription added to network manager
76+
az network manager show --resource-group myAVNMResourceGroup --name myAVNM
77+
```
78+
79+
## Add static members to your network group
80+
In this task, you'll add a cross-tenant virtual network to your network group with static membership. The virtual network subscription used below is the same as referenced when creating connections above.
81+
82+
```azurecli
83+
# Create network group with static member from target managed tenant
84+
az network manager group static-member create --network-group-name "CrossTenantNetworkGroup" --network-manager-name "myAVNM" --resource-group "myAVNMResourceGroup" --static-member-name "targetVnet01" --resource-id="/subscriptions/dec492d3-4f4e-493b-aa47-7bdf2f96a6fc/resourceGroups/myScopeAVNM/providers/Microsoft.Network/virtualNetworks/targetVnet01"
85+
```
86+
87+
5. Now that the virtual network is in the network group, configurations will be applied. To remove the static member or cross-tenant resources, use the corresponding delete commands.
88+
89+
```azurecli
90+
91+
# Delete static member group
92+
az network manager group static-member delete --network-group-name "CrossTenantNetworkGroup" --network-manager-name " myAVNM" --resource-group "myRG" --static-member-name "fabrikamVnet”
93+
94+
# Delete scope connections
95+
az network manager scope-connection delete --resource-group "myRG" --network-manager-name "myAVNM" --name "ToTargetManagedTenant"
96+
97+
# Switch to ‘managed tenant’ if needed
98+
#
99+
az network manager connection subscription delete --name "toCentralManagementTenant"
100+
101+
```
102+
103+
## Next steps
104+
105+
> [!div class="nextstepaction"]
106+
107+
- Learn more about [Security admin rules](concept-security-admins.md).
108+
109+
- Learn how to [create a mesh network topology with Azure Virtual Network Manager using the Azure portal](how-to-create-mesh-network.md)
110+
111+
- Check out the [Azure Virtual Network Manager FAQ](faq.md)

0 commit comments

Comments
 (0)