Azure Databricks 发布管道访问问题

问题描述 投票:0回答:1

情况:

我想发布 Databricks 工作区、集群、作业和笔记本。

一切都通过 VS Code 和 AZ Login 进行。 当我运行 Azure Devops Pipeline 时,出现以下错误。

 Error: cannot read job: User *** does not have Admin or Manage Run or Owner or View permissions on job 419617767162993
    │ 
    │   with databricks_job.this,
    │   on **job.tf** line 1, in resource "databricks_job" "this":
    │    1: resource "databricks_job" "this" {
     

 Error: cannot read group member: /2.0/preview/scim/v2/Groups/576792616350882 is only accessible by admins.
╷
│ Error: cannot read service principal: /2.0/preview/scim/v2/ServicePrincipals/3879246038660033 is only accessible by admins.

╷
│ Error: cannot read job: default auth: cannot configure default credentials, please check https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication to configure credentials for your preferred authentication method

YAML 步骤:

- task: AzureCLI@2
    displayName: 'tf plan '
    inputs:
      azureSubscription: '${{ variables.backendServiceArm }}'
      scriptType: bash
      scriptLocation: inlineScript
      inlineScript: 'terraform plan -lock=false -out notebooks.state.plan'
      # scriptArguments: "-out notebooks.state.plan"
      workingDirectory: '$(System.DefaultWorkingDirectory)/terraform/'
      addSpnToEnvironment: true

工作.tf

resource "databricks_job" "this" {
  # provider = databricks.etl_workspace_provider <-- tried both on/off

尝试与错误: 我尝试了很多创造的东西:

  • 新的作业集群/重新使用现有集群。
  • 添加提供商/删除提供商
  • 以管理员身份将 azure devops sp 添加到集群并勾选所有权限。

简单地说,我希望我的管道运行时没有错误,并且我真的不想使用 Unity 目录或任何 SCIM 东西。

azure-devops databricks azure-databricks azure-pipelines-yaml
1个回答
0
投票

当您使用服务主体作为部署 Azure Databricks 工作区、集群、作业和笔记本的授权时,需要检查服务主体的以下权限:

  1. 首先,找到管道中AzureCLI@2

    任务使用的ARM服务连接(
    Azure资源管理器服务连接)的服务主体。在 Azure DevOps 项目中,转到“项目设置”>“服务连接”,找到并单击 ARM 服务连接以打开其“
    Overview
    ”。单击“
    Manage Service Principal
    ”以在 Azure 门户上打开关联的服务主体。请记住服务主体的名称 (
    Display name
    ) 和 ID (
    Application (client) ID
    )。

  2. 确保服务主体至少在 Azure 订阅上具有

    Contributor
    角色。

  3. 要使用服务主体管理 Azure Databricks 工作区中的资源和设置,您还需要将服务主体添加到工作区中的

    admins
    组中。

    • 打开工作区管理设置页面。

    • 将服务主体添加到工作区中。

    • 将服务主体添加到工作区中的

      admins
      组。


© www.soinside.com 2019 - 2024. All rights reserved.