プライベート接続エンドポイントの管理: Azure

このトピックでは、外部サービスへのプライベート接続で使用するプライベート接続エンドポイントの管理方法について説明します。

プライベート接続エンドポイントのプロビジョニング

SYSTEM$PROVISION_PRIVATELINK_ENDPOINT システム関数を呼び出すことで、プライベート接続エンドポイントを作成できます。例えば、 Microsoft Azure のSnowflakeアカウントの場合:

プライベートエンドポイントをプロビジョニングして、 Microsoft Azure のSnowflakeが Microsoft Azure VNet の Microsoft Azure API 管理サービスに接続できるようにします。

SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
  '/subscriptions/f4b00c5f-f6bf-41d6-806b-e1cac4f1f36f/resourceGroups/aztest1-external-function-rg/providers/Microsoft.ApiManagement/service/aztest1-external-function-api',
  'aztest1-external-function-api.azure.net',
  'Gateway'
  );
Copy
Private endpoint with ID "/subscriptions/e48379a7-2fc4-473e-b071-f94858cc83f5/resourcegroups/test_rg/providers/microsoft.network/privateendpoints/32bd3122-bfbd-417d-8620-1a02fd68fcf8" to resource "/subscriptions/f4b00c5f-f6bf-41d6-806b-e1cac4f1f36f/resourceGroups/aztest1-external-function-rg/providers/Microsoft.ApiManagement/service/aztest1-external-function-api" has been provisioned successfully. Please note down the endpoint ID and approve the connection from it on the Azure portal.

プライベートエンドポイントをプロビジョニングして、 Microsoft Azure のSnowflakeが外部ネットワークアクセスを使用して外部サービスに接続できるようにします。

SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
  '/subscriptions/11111111-2222-3333-4444-5555555555/resourceGroups/leorg1/providers/Microsoft.Sql/servers/myserver/databases/testdb',
  'testdb.database.windows.net',
  'sqlServer'
  );
Copy
"Resource Endpoint with id "/subscriptions/f0abb333-1b05-47c6-8c31-dd36d2512fd1/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/external-network-access-pe" provisioned successfully"

プライベートエンドポイントをプロビジョニングして、Snowflakeが Microsoft Azure 用の外部ステージに接続できるようにします。

SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
  '/subscriptions/cc2909f2-ed22-4c89-8e5d-bdc40e5eac26/resourceGroups/mystorage/providers/Microsoft.Storage/storageAccounts/storagedemo',
  'storagedemo.blob.core.windows.net',
  'blob'
);
Copy
"Resource Endpoint with id "/subscriptions/57faea9a-20c2-4d35-b283-9c0c1e9593d8/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/external-network-access-pe" provisioned successfully"

Snowflakeは、Snowflakeアカウントをホストするクラウドプラットフォームの APIs を呼び出してエンドポイントを作成し、関連するネットワーク設定を更新します。

プライベート接続エンドポイントのリスト

SYSTEM$GET_PRIVATELINK_ENDPOINTS_INFO システム関数を呼び出すことで、作成したプライベート接続エンドポイントを一覧表示できます。例えば、 Microsoft Azure のSnowflakeアカウントの場合:

SELECT SYSTEM$GET_PRIVATELINK_ENDPOINTS_INFO();
Copy
[
   {
      "host": "aztest1-external-function-api.azure-api.net",
      "status": "APPROVED",
      "resource_id":  "/subscriptions/fa57a1f0-b4e6-4847-9c00-95f39520f35e/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/apim-pe"
   }
]
Copy

プライベート接続エンドポイントのデプロビジョニング

既存のプライベート接続エンドポイントを削除するには、 SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT システム関数を呼び出します。例えば、 Microsoft Azure のSnowflakeアカウントの場合:

プライベートエンドポイントをデプロビジョニングして、Microsoft Azure上のSnowflakeが Microsoft Azure VNet の Microsoft Azure API 管理サービスに接続しないようにします。

SELECT SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT(
  '/subscriptions/f4b00c5f-f6bf-41d6-806b-e1cac4f1f36f/resourceGroups/aztest1-external-function-rg/providers/Microsoft.ApiManagement/service/aztest1-external-function-api',
  'Gateway'
  );
Copy
Private endpoint with id "/subscriptions/e48379a7-2fc4-473e-b071-f94858cc83f5/resourcegroups/test_rg/providers/microsoft.network/privateendpoints/5ef8fd34-07db-4583-b0dd-0e2360398ed3" successfully marked for deletion. Before it is fully deleted in 7-8 days, it can be restored.

プライベートエンドポイントをデプロビジョニングして、 Microsoft Azure のSnowflakeが外部ネットワークアクセスを使って外部サービスに接続できないようにします。

SELECT SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT(
  '/subscriptions/11111111-2222-3333-4444-5555555555/resourceGroups/leorg1/providers/Microsoft.Sql/servers/myserver/databases/testdb',
  'sqlServer'
  );
Copy
"Resource Endpoint with id "/subscriptions/f0abb333-1b05-47c6-8c31-dd36d2512fd1/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/external-network-access-pe" deprovisioned successfully"

プライベートエンドポイントをデプロビジョニングして、Snowflakeが Microsoft Azure の外部ステージに接続できないようにします。

SELECT SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT(
  'storagedemo.blob.core.windows.net',
  'blob'
);
Copy
"Resource Endpoint with id "/subscriptions/57faea9a-20c2-4d35-b283-9c0c1e9593d8/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/external-network-access-pe" deprovisioned successfully"

デプロビジョニングされたプライベート接続エンドポイントの復元

SYSTEM$RESTORE_PRIVATELINK_ENDPOINT システム関数を呼び出すことで、デプロビジョニングしてから7日以内にデプロビジョニングしたプライベート接続エンドポイントを復元できます。7日を過ぎるとエンドポイントは復元できなくなるので、新しいエンドポイントをプロビジョニングする必要があります。

プライベートエンドポイントを復元して、Microsoft Azure上のSnowflakeがAzure VNet のAzure API 管理サービスに接続できるようにします。

SELECT SYSTEM$RESTORE_PRIVATELINK_ENDPOINT(
  '/subscriptions/11111111-2222-3333-4444-5555555555/resourceGroups/my_rg/providers/Microsoft.Sql/servers/my_db_server',
  'sqlServer'
);
Copy
Private endpoint with id ''/subscriptions/66666666-7777-8888-9999-0000000000/resourcegroups/rg/providers/microsoft.network/privateendpoints/00000000-1111-2222-3333-4444444444'' restored successfully.

トラブルシューティング

Microsoft Azure 外部サービス: 指定したサブスクリプションにアクセスできません

エラー

(LinkedAuthorizationFailed) The client has permission to perform action '<action_name>' on scope '<service_name>', however the current tenant '<tenant_id>' is not authorized to access linked subscription '<subscription_id'.

Code: LinkedAuthorizationFailed

Message: The client has permission to perform action '<action_name>' on scope '<service_name>', however the current tenant '<tenant_id>' is not authorized to access linked subscription '<subscription_id>'.

原因

外部サービスにマップするプライベートエンドポイントは、サブスクリプションにアクセスするための正しい情報を持っていません。

解決策

  1. SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT システム関数を呼び出して、外部サービスのエンドポイントを削除します。

  2. SYSTEM$PROVISION_PRIVATELINK_ENDPOINT システム関数を呼び出して、外部サービスのエンドポイントを再作成します。サブスクリプション、ホスト名、サブリソースの値を正しく指定してください。

  3. ネットワークルールを 置き換えVALUE_LIST プロパティに正しいホスト名の値を指定してください。