プライベート接続エンドポイントの管理: 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'
);
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'
);
"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'
);
"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();
[
{
"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"
}
]
プライベート接続エンドポイントのデプロビジョニング¶
既存のプライベート接続エンドポイントを削除するには、 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'
);
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'
);
"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'
);
"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'
);
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>'.
|
---|---|
原因 |
外部サービスにマップするプライベートエンドポイントは、サブスクリプションにアクセスするための正しい情報を持っていません。 |
解決策 |
|