Azure Virtual Network Manager でテナント間接続を構成するプレビュー - CLI

この記事では、Azure CLI を使用して Azure Virtual Network Manager でテナント間接続を作成する方法について説明します。 テナント間のサポートにより、組織は中央のネットワーク マネージャーを使用して、テナントとサブスクリプション間で仮想ネットワークを管理できます。

最初に、中央のネットワーク マネージャーでスコープ接続を作成します。 次に、接続しているテナントにネットワーク マネージャー接続を作成し、接続を確認します。 最後に、異なるテナントから仮想ネットワークを追加して、確認します。 すべてのタスクを完了すると、自身のネットワーク マネージャーから他のテナントのリソースを集中管理できます。

前提条件

  • Azure Virtual Network Manager を使用して管理する仮想ネットワークを持つ 2 つの Azure テナント。 この記事では、テナントについて次のように参照します。
    • 中央管理テナント: Azure Virtual Network Manager インスタンスがインストールされているテナント。テナント間接続からネットワーク グループを一元管理します。
    • ターゲット マネージド テナント: 管理対象の仮想ネットワークを含むテナント。 このテナントは、中央管理テナントに接続されます。
  • 中央管理テナントにデプロイされた Azure Virtual Network Manager。
  • これらのアクセス許可には、次のような特徴があります。
    • 中央管理テナントの管理者は、ターゲット管理テナントにゲスト アカウントを持っています。
    • 管理者ゲスト アカウントには、適切なスコープ レベル (管理グループ、サブスクリプション、または仮想ネットワーク) で適用されるネットワーク 共同作成者 のアクセス許可が含まれます。

アクセス許可の設定に関するヘルプが必要ですか? Azure portal にゲスト ユーザーを追加する方法と、Azure portal のリソースにユーザー ロールを割り当てる方法を確認する。

ネットワーク マネージャー内でスコープ接続を作成する

スコープ接続の作成は、ネットワーク マネージャーがデプロイされた中央管理テナントで始めます。 これは、テナント間ですべてのリソースを管理する予定のネットワークマネージャーです。

このタスクでは、ターゲット テナントからサブスクリプションを追加するためのスコープ接続を設定します。 ターゲット ネットワーク マネージャーのサブスクリプション ID とテナント ID を使用します。 管理グループを使用する場合は、/providers/Microsoft.Management/managementGroups/{mgId} のように –resource-id 引数を変更します。

# Create a scope connection in the network manager in the central management tenant
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/13579864-1234-5678-abcd-0987654321ab" --tenant-id "24680975-1234-abcd-56fg-121314ab5643"

別のテナントのサブスクリプションでネットワーク マネージャー接続を作成する

スコープ接続を作成したら、ネットワーク マネージャー接続のターゲット テナントに切り替えます。 このタスクでは、先ほど作成したスコープ接続にターゲット テナントを接続します。 また、接続の状態も確認します。

  1. 次のコマンドを入力して、管理アカウントを使用してターゲット マネージド テナントに接続します。

    
    # Log in to the target managed tenant
    # Change the --tenant value to the appropriate tenant ID
    az login --tenant "12345678-12a3-4abc-5cde-678909876543"
    

    組織のポリシーに基づいて、組織との認証を完了する必要があります。

  2. 次のコマンドを入力してサブスクリプションを設定し、中央管理テナントでテナント間接続を作成します。 サブスクリプションは、前の手順で接続から参照されたサブスクリプションと同じです。

    # Set the Azure subscription
    az account set --subscription 87654321-abcd-1234-1def-0987654321ab
    
    
    # Create a cross-tenant connection to the central management tenant
    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/13579864-1234-5678-abcd-0987654321ab/resourceGroups/myRG/providers/Microsoft.Network/networkManagers/myAVNM"
    

接続状態を確認する

  1. 次のコマンドを入力して、接続の状態を確認します。

    # Check connection status
    az network manager connection subscription show --name "toCentralManagementTenant"
    
  2. 中央管理テナントに戻ります。 ネットワーク マネージャーの show コマンドを使用して、テナント間スコープのプロパティを介して追加されたサブスクリプションを表示します。

    # View the subscription added to the network manager
    az network manager show --resource-group myAVNMResourceGroup --name myAVNM
    

静的メンバーをネットワーク グループに追加する

このタスクでは、静的メンバーシップを使用して、テナント間仮想ネットワークをネットワーク グループに追加します。 次のコマンドでは、仮想ネットワーク サブスクリプションは、前に接続を作成したときに参照したサブスクリプションと同じです。

# Create a network group with a static member from the target managed tenant
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/87654321-abcd-1234-1def-0987654321ab
/resourceGroups/myScopeAVNM/providers/Microsoft.Network/virtualNetworks/targetVnet01"

ネットワーク マネージャー構成を削除する

仮想ネットワークがネットワーク グループ内に存在するようになったので、構成が適用されます。 静的メンバーまたはテナント間リソースを削除するには、次のように対応する delete コマンドを使用します。


# Delete the static member group
az network manager group static-member delete --network-group-name  "CrossTenantNetworkGroup" --network-manager-name " myAVNM" --resource-group "myRG" --static-member-name "targetVnet01” 

# Delete scope connections
az network manager scope-connection delete --resource-group "myRG" --network-manager-name "myAVNM" --name "ToTargetManagedTenant" 

# Switch to a managed tenant if needed 
az network manager connection subscription delete --name "toCentralManagementTenant"  

次のステップ