次の方法で共有


サービス プリンシパルの資格情報を更新

この記事では、データ コントローラーのシークレットを更新する方法について説明します。

たとえば、次の場合があるとします。

  • サービス プリンシパルのテナント ID、クライアント ID、およびクライアント シークレットの特定の値セットを使用してデータ コントローラーをデプロイしました
  • これらの値の 1 つ以上を変更します

データ コントローラーのシークレットを更新する必要があります。

背景

サービス プリンシパルは、サービス プリンシパルの作成で作成されました。

手順

  1. 既定のエディターでサービス プリンシパル シークレットにアクセスします。

    kubectl edit secret/upload-service-principal-secret -n <name of namespace>
    

    たとえば、arc 名前空間内のデータ コントローラーに対してサービス プリンシパル シークレットを編集するには、次のコマンドを実行します。

    kubectl edit secret/upload-service-principal-secret -n arc
    

    kubectl edit コマンドを実行すると、既定のエディターで credentials.yml ファイルが開きます。

  2. サービス プリンシパル シークレットを編集します。

    既定のエディターで、データ セクションの値を更新された資格情報に置き換えます。

    次に例を示します。

    # Please edit the object below. Lines beginning with a '#' will be ignored,
    # and an empty file will abort the edit. If an error occurs while saving this file will be
    # reopened with the relevant failures.
    #
    apiVersion: v1
    data:
      authority: <authority id>
      clientId: <client id>
      clientSecret: <client secret>==
      tenantId: <tenant id>
    kind: Secret
    metadata:
      creationTimestamp: "2020-12-02T05:02:04Z"
      name: upload-service-principal-secret
      namespace: arc
      resourceVersion: "7235659"
      selfLink: /api/v1/namespaces/arc/secrets/upload-service-principal-secret
      uid: <globally unique identifier>
    type: Opaque
    

    必要に応じて、clientIDclientSecrettenantID の値を編集します。

Note

値は base64 でエンコードする必要があります。 その他のプロパティは編集しないでください。

clientIdclientSecret、またはtenantID に不正な値が指定されている場合、control-xxxx ポッドまたはコントローラーのコンテナー ログに次のようなエラー メッセージが表示されます。

YYYY-MM-DD HH:MM:SS.mmmm | ERROR | [AzureUpload] Upload task exception: A configuration issue is preventing authentication - check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret is provided.