비밀 CLI(레거시)

Important

이 설명서는 사용 중지되었으며 업데이트되지 않을 수 있습니다.

이 정보는 레거시 Databricks CLI 버전 0.18 이하에 적용됩니다. Databricks는 최신 Databricks CLI 버전 0.205 이상을 대신 사용하는 것이 좋습니다. Databricks CLI란?을 참조하세요. Databricks CLI 버전을 찾으려면 다음을 실행 databricks -v합니다.

Databricks CLI 버전 0.18 이하에서 Databricks CLI 버전 0.205 이상으로 마이그레이션하려면 Databricks CLI 마이그레이션을 참조하세요.

Databricks 비밀 CLI 하위 명령을 databricks secrets에 추가하여 실행합니다. 이러한 하위 명령은 비밀 API호출합니다.

비밀에 대한 자세한 내용은 비밀 관리를 참조하세요.

참고 항목

비밀 CLI에는 Databricks CLI 0.7.1 이상이 필요합니다.

databricks secrets --help
Usage: databricks secrets [OPTIONS] COMMAND [ARGS]...

  Utility to interact with secret API.

Options:
  -v, --version   [VERSION]
  --profile TEXT  CLI connection profile to use. The default profile is
                  "DEFAULT".
  -h, --help      Show this message and exit.

Commands:
  create-scope  Creates a secret scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --initial-manage-principal     The initial principal that can manage the created secret scope.
                                      If specified, the initial ACL with MANAGE permission applied
                                      to the scope is assigned to the supplied principal (user or group).
                                      The only supported principal is the group
                                      "users", which contains all users in the workspace. If not
                                      specified, the initial ACL with MANAGE permission applied to
                                      the scope is assigned to request issuer's user identity.
  delete        Deletes a secret.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --key KEY                      The name of secret key.
  delete-acl    Deletes an access control rule for a principal.
    Options:
      --scope SCOPE                  The name of the scope.
      --principal PRINCIPAL          The name of the principal.
  delete-scope  Deletes a secret scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
  get-acl       Gets the details for an access control rule.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --principal PRINCIPAL          The name of the principal.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  list          Lists all the secrets in a scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  list-acls     Lists all access control rules for a given secret scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  list-scopes   Lists all secret scopes.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  put           Puts a secret in a scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --key KEY                      The name of the secret key.
      --string-value TEXT            Read value from string and stored in UTF-8 (MB4) form
      --binary-file PATH             Read value from binary-file and stored as bytes.
  put-acl       Creates or overwrites an access control rule for a principal
                applied to a given secret scope.
    Options:
      --scope SCOPE                    The name of the secret scope.
      --principal PRINCIPAL            The name of the principal.
      --permission [MANAGE|WRITE|READ] The permission to apply.
  write         Puts a secret in a scope. "write" is an alias for "put".
    Options:
      --scope SCOPE                  The name of the secret scope.
      --key KEY                      The name of the secret key.
      --string-value TEXT            Read value from string and stored in UTF-8 (MB4) form
      --binary-file PATH             Read value from binary-file and stored as bytes.
  write-acl     Creates or overwrites an access control rule for a principal
                applied to a given secret scope. "write-acl" is an alias for
                "put-acl".
    Options:
      --scope SCOPE                    The name of the secret scope.
      --principal PRINCIPAL            The name of the principal.
      --permission [MANAGE|WRITE|READ] The permission to apply.

비밀 범위 만들기

사용 설명서를 표시하려면 databricks secrets create-scope --help를 실행합니다.

databricks secrets create-scope --scope my-scope

성공하면 출력이 표시되지 않습니다.

Databricks CLI를 사용하여 Azure Key Vault 지원 비밀 범위를 만들려면 databricks secrets create-scope --help를 실행하여 추가 --scope-backend-type, --resource-id--dns-name 옵션에 대한 정보를 표시합니다. 자세한 내용은 비밀을 참조하세요.

비밀 삭제

사용 설명서를 표시하려면 databricks secrets delete --help를 실행합니다.

databricks secrets delete --scope my-scope --key my-key

성공하면 출력이 표시되지 않습니다.

보안 주체에 대한 ACL 취소

사용 설명서를 표시하려면 databricks secrets delete-acl --help를 실행합니다.

databricks secrets delete-acl --scope my-scope --principal someone@example.com

성공하면 출력이 표시되지 않습니다.

비밀 범위 삭제

사용 설명서를 표시하려면 databricks secrets delete-scope --help를 실행합니다.

databricks secrets delete-scope --scope my-scope

성공하면 출력이 표시되지 않습니다.

보안 주체에 대한 ACL 가져오기

사용 설명서를 표시하려면 databricks secrets get-acl --help를 실행합니다.

databricks secrets get-acl --scope my-scope --principal someone@example.com --output JSON
{
  "principal": "sonmeone@example.com",
  "permission": "MANAGE"
}

비밀 범위 내에 저장된 비밀 키 나열

사용 설명서를 표시하려면 databricks secrets list --help를 실행합니다.

databricks secrets list --scope my-scope --output JSON
{
  "secrets": [
    {
      "key": "my-key",
      "last_updated_timestamp": 1621284092605
    }
  ]
}

참고 항목

Databricks CLI를 사용하여 비밀 값에 액세스할 수 없습니다. 비밀 값에 액세스하려면 Databricks Notebook 내에서 Databricks Utilities 비밀 유틸리티를 사용해야 합니다.

비밀 범위에 대한 ACL 나열

사용 설명서를 표시하려면 databricks secrets list-acls --help를 실행합니다.

databricks secrets list-acls --scope my-scope --output JSON
{
  "items": [
    {
      "principal": "someone@example.com",
      "permission": "MANAGE"
    }
  ]
}

작업 영역에서 사용 가능한 모든 비밀 범위 나열

사용 설명서를 표시하려면 databricks secrets list-scopes --help를 실행합니다.

databricks secrets list-scopes --output JSON
{
  "scopes": [
    {
      "name": "my-scope",
      "backend_type": "DATABRICKS"
    }
  ]
}

비밀 만들기 또는 업데이트

사용 설명서를 표시하려면 databricks secrets put --help 또는 databricks secrets write --help를 실행합니다.

비밀을 저장하는 세 가지 방법이 있습니다. 가장 쉬운 방법은 --string-value 옵션을 사용하는 것입니다. 비밀은 UTF-8(MB4) 형식으로 저장됩니다. 비밀이 명령줄 기록에 일반 텍스트로 저장될 수 있으므로 이 옵션에 주의해야 합니다.

databricks secrets put --scope my-scope --key my-key --string-value my-value

또는

databricks secrets write --scope my-scope --key my-key --string-value my-value

성공하면 출력이 표시되지 않습니다.

--binary-file 옵션을 사용하여 파일에 저장된 비밀을 제공할 수도 있습니다. 파일 내용은 있는 그대로 읽고 바이트로 저장됩니다.

databricks secrets put --scope my-scope --key my-key --binary-file my-secret.txt

또는

databricks secrets write --scope my-scope --key my-key --binary-file my-secret.txt

성공하면 출력이 표시되지 않습니다.

옵션을 지정하지 않으면 비밀을 입력할 수 있는 편집기가 열립니다. 편집기에 표시된 지침에 따라 비밀을 입력합니다.

databricks secrets put --scope my-scope --key my-key

또는

databricks secrets write --scope my-scope --key my-key

# ----------------------------------------------------------------------
# Do not edit the above line. Everything below it will be ignored.
# Please input your secret value above the line. Text will be stored in
# UTF-8 (MB4) form and any trailing new line will be stripped.
# Exit without saving will abort writing secret.

보안 주체의 비밀 범위에 대한 ACL 부여 또는 변경

사용 설명서를 표시하려면 databricks secrets put-acl --help 또는 databricks secrets write-acl --help를 실행합니다.

databricks secrets put-acl --scope my-scope --principal someone@example.com --permission MANAGE

또는

databricks secrets write-acl --scope my-scope --principal someone@example.com --permission MANAGE

성공하면 출력이 표시되지 않습니다.