マネージドサービスの認証情報
この記事では、外部クラウド サービスへのアクセスを制御できるセキュリティ保護可能なオブジェクト Unity Catalog であるサービス資格情報の一覧表示、表示、更新、アクセス許可の付与、および削除の方法について説明します。
関連項目は次を参照してください。
- 概要とサービス資格情報の作成方法については、「サービス資格情報を使用して外部クラウド サービスへのアクセスを管理する」を参照してください。
- コードでサービス資格情報を参照する方法と、コンピュート リソースのデフォルト サービス資格情報を指定する方法については、「Unity Catalog サービス資格情報を使用して外部クラウド サービスに接続する」を参照してください。
始める前に
この記事で説明するタスクを実行するには、次の要件を満たす必要があります。
-
Unity Catalogに対してDatabricksワークスペースが有効になっていること。
-
サービス認証情報を一覧表示または表示するには、次のいずれかの権限またはロールが必要です。
BROWSE
親カタログに対する権限CREATE SERVICE CREDENTIAL
メタストア上ACCESS
サービス資格情報- サービス資格情報の所有者
- メタストア管理者
-
この記事に記載されているその他のタスクを実行するには、サービス資格情報の所有者またはメタストア管理者である必要があります。
-
SQLコマンドを使用してサービス資格情報を一覧表示、表示、または更新する場合は、Databricks Runtime 16.2 以降にコンピュートが必要です。カタログ エクスプローラーまたは REST API を使用する場合、Databricks Runtime のバージョン要件はありません。
サービス資格情報の一覧表示
メタストア内のすべてのサービス資格情報の一覧を表示するには、カタログ エクスプローラーまたは SQL コマンドを使用できます。
- Catalog Explorer
- SQL
- In the sidebar, click
Catalog.
- On the Quick access page, click the External data > button and go to the Credentials tab.
- Sort the credentials by Purpose (STORAGE or SERVICE).
Run the following command in a notebook.
SHOW SERVICE CREDENTIALS;
サービス資格情報の表示
サービス認証情報のプロパティを表示するには、Catalog Explorer または SQL コマンドを使用できます。
- Catalog Explorer
- SQL
- In the sidebar, click
Catalog.
- On the Quick access page, click the External data > button and go to the Credentials tab.
- Click the name of a service credential to see its properties.
Run the following command in a notebook. Replace <credential-name>
with the name of the credential.
DESCRIBE SERVICE CREDENTIAL <credential-name>;
サービス認証情報の権限の表示
サービス認証情報に権限を表示するには、次のようなコマンドを使用します。 オプションで、結果をフィルタリングして、指定したプリンシパルの権限のみを表示することができます。
SHOW GRANTS [<principal>] ON SERVICE CREDENTIAL <service-credential-name>;
プレースホルダーの値を置き換えます。
<principal>
: アカウントレベルのユーザーのEメール アドレス、または権限を付与されたアカウントレベルのグループの名前。<service-credential-name>
: サービス資格情報の名前。
グループまたはユーザー名にスペースまたは @
記号が含まれている場合は、アポストロフィではなくバッククォートで囲みます。 たとえば 財務チームは.
サービス資格情報を使用して外部クラウド サービスにアクセスするためのアクセス許可を付与する
サービス認証情報を使用して外部クラウドサービスにアクセスする権限を付与するには、次の手順を実行します。 Catalog Explorer または SQL コマンドを使用できます。
- Catalog Explorer
- SQL
- In the sidebar, click
Catalog.
- On the Quick access page, click the External data > button and go to the Credentials tab.
- Click the name of a service credential to open the details page.
- Click Permissions.
- To grant permission to users or groups, select each identity, then click Grant.
- Select ACCESS to grant the ability to use the service credential to access an external cloud service or services.
- Select CREATE CONNECTION to grant the ability to create a Lakehouse Federation connection in Unity Catalog using this service credential. See Manage connections for Lakehouse Federation.
- To revoke permissions from users or groups, select each identity, then click Revoke.
To grant access, run one of the following commands in a notebook, replacing the placeholder values:
-
<principal>
: The email address of the account-level user or the name of the account level group to whom to grant the permission. -
<service-credential-name>
: The name of a service credential.
If a group or username contains a space, dash (-
), or @
symbol, use back-ticks around it (not apostrophes). For example, `finance team`.
GRANT ACCESS ON SERVICE CREDENTIAL <service-credential-name> TO <principal>;
If you want to grant the ability to create a Lakehouse Federation connection in Unity Catalog using this service credential, use the following:
GRANT CREATE CONNECTION ON SERVICE CREDENTIAL <service-credential-name> TO <principal>;
To revoke access, replace GRANT
with REVOKE
in these examples.
サービス資格情報の所有者を変更する
サービス資格情報の作成者は、その初期所有者です。 所有者を別のアカウントレベルのユーザーまたはグループに変更するには、Catalog Explorer または SQL コマンドを使用できます。
- Catalog Explorer
- SQL
- In the sidebar, click
Catalog.
- On the Quick access page, click the External data > button and go to the Credentials tab.
- Click the name of a service credential to open the edit dialog.
- Click
next to Owner.
- Type to search for a principal and select it.
- Click Save.
Run the following command in a notebook. Replace the placeholder values:
<credential-name>
: The name of the credential.<principal>
: The email address of an account-level user or the name of an account-level group.
ALTER SERVICE CREDENTIAL <credential-name> OWNER TO <principal>;
サービス資格情報の名前を変更する
サービス認証情報の名前を変更するには、カタログエクスプローラーまたは SQL コマンドを使用できます。
- Catalog Explorer
- SQL
- In the sidebar, click
Catalog.
- On the Quick access page, click the External data > button and go to the Credentials tab.
- Click the name of a service credential to open the edit dialog.
- Rename the service credential and save it.
Run the following command in a notebook. Replace the placeholder values:
<credential-name>
: The name of the credential.<new-credential-name>
: A new name for the credential.
ALTER SERVICE CREDENTIAL <credential-name> RENAME TO <new-credential-name>;
サービス資格情報の削除
サービス資格情報を削除 (ドロップ) するには、その所有者である必要があります。 サービス認証情報を削除するには、Catalog Explorer または SQL コマンドを使用できます。
- Catalog Explorer
- SQL
- In the sidebar, click
Catalog.
- On the Quick access page, click the External data > button and go to the Credentials tab.
- Click the name of a service credential to open the edit dialog.
- Click the Delete button.
Run the following command in a notebook. Replace <credential-name>
with the name of the credential. Portions of the command that are in brackets are optional.
IF EXISTS
does not return an error if the credential does not exist.
DROP SERVICE CREDENTIAL [IF EXISTS] <credential-name>;