Azure Databricks Terraform提供程序的管理员用户创建身份验证设置

huangapple go评论72阅读模式
英文:

Azure databrick terraform provider authentication setup for admin user creation

问题

I am getting error while terraform plan while creating databrick_group databrick_user while using databrickslabs/databricks (v0.5.4) :

2023-06-07T14:50:50.4892773Z Error: Invalid JSON received (529 bytes): <!doctype html><html><head><meta charset="utf-8"/><meta http-equiv="Content-Language" content="en"/><title>Databricks - Sign In</title><meta name="viewport" content="width=960"/><link rel="icon" type="image/png" href="/favicon.ico"/><meta http-equiv="content-type" content="text/html; charset=UTF8"/><link rel="icon" href="/favicon.ico"><script defer="defer" src="/static/js/login/login.96b6985d.js"></script></head><body class="light-mode"><uses-legacy-bootstrap><div id="login-page"></div></uses-legacy-bootstrap></body></html>

with module.databricks.data.databricks_group.admins,
on ../modules/landingzone/FADS/databricks/databricks_admin.tf line 8, in data "databricks_group" "admins":
 8: data "databricks_group" "admins" {

Here is part of the terraform snippet:

provider "databricks" {
  host = azurerm_databricks_workspace.databricks_workspace.workspace_url
  azure_workspace_resource_id = azurerm_databricks_workspace.databricks_workspace.id
}

# Gathers data about the admins Databricks workspace group
data "databricks_group" "admins" {
  display_name = "admins"
  depends_on = [azurerm_databricks_workspace.databricks_workspace]
}

resource "databricks_user" "admin_user" {
    for_each = var.databricks.databricks_admin_users
  user_name = each.key
  depends_on = [azurerm_databricks_workspace.databricks_workspace]
}

I am using a Service Principal that has owner permission on the subscription for terraform deployment. Is there missing authentication, if yes how do I provide these in provider block?

英文:

I am getting error while terraform plan while creating databrick_group databrick_user while using databrickslabs/databricks (v0.5.4) :

2023-06-07T14:50:50.4892773Z Error: Invalid JSON received (529 bytes): <!doctype html><html><head><meta charset="utf-8"/><meta http-equiv="Content-Language" content="en"/><title>Databricks - Sign In</title><meta name="viewport" content="width=960"/><link rel="icon" type="image/png" href="/favicon.ico"/><meta http-equiv="content-type" content="text/html; charset=UTF8"/><link rel="icon" href="/favicon.ico"><script defer="defer" src="/static/js/login/login.96b6985d.js"></script></head><body class="light-mode"><uses-legacy-bootstrap><div id="login-page"></div></uses-legacy-bootstrap></body></html>

with module.databricks.data.databricks_group.admins,
on ../modules/landingzone/FADS/databricks/databricks_admin.tf line 8, in data "databricks_group" "admins":
 8: data "databricks_group" "admins" {

Here is part of the terraform snippet:

provider "databricks" {
  host = azurerm_databricks_workspace.databricks_workspace.workspace_url
  azure_workspace_resource_id = azurerm_databricks_workspace.databricks_workspace.id
}

# Gathers data about the admins Databricks workspace group
data "databricks_group" "admins" {
  display_name = "admins"
  depends_on = [azurerm_databricks_workspace.databricks_workspace]
}

resource "databricks_user" "admin_user" {
    for_each = var.databricks.databricks_admin_users
  user_name = each.key
  depends_on = [azurerm_databricks_workspace.databricks_workspace]
}

I am using a Service Principal that has owner permission on the subscription for terraform deployment. Is there missing authentication, if yes how do I provide these in provider block?

答案1

得分: 0

如果您使用服务主体创建了工作区,那么您需要继续使用它进行身份验证。身份验证参数可以通过两种方式指定:

  • 环境变量 - Databricks 提供程序使用与 azurerm 提供程序相同的变量
  • 直接在配置块中 - 如文档所述:
provider "databricks" {
  host                        = azurerm_databricks_workspace.this.workspace_url
  azure_workspace_resource_id = azurerm_databricks_workspace.this.id
  azure_client_id             = var.client_id
  azure_client_secret         = var.client_secret
  azure_tenant_id             = var.tenant_id
}

但如果您刚刚创建了一个工作区,那么您还需要提供工作区资源 ID 作为 azure_workspace_resource_id 参数。

P.S. 您需要升级 Databricks 提供程序 - 这不是支持的版本。

英文:

If you created a workspace using the service principal, then you need to continue to use it for authentication. Authentication parameters could be specified two ways:

  • Environments variables - Databricks provider uses the same variables as azurerm provider
  • Directly in configuration block - as described in the docs:
provider "databricks" {
  host                        = azurerm_databricks_workspace.this.workspace_url
  azure_workspace_resource_id = azurerm_databricks_workspace.this.id
  azure_client_id             = var.client_id
  azure_client_secret         = var.client_secret
  azure_tenant_id             = var.tenant_id
}

But if you just created a workspace, then you need also to provide workspace resource ID as azure_workspace_resource_id parameter.

P.S. You need to upgrade Databricks provider - this is not supported version.

huangapple
  • 本文由 发表于 2023年6月8日 22:58:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76433170.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定