<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error: cannot create mws credentials: invalid Databricks Account configuration in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57638#M30845</link>
    <description>&lt;P&gt;Hi, Looks like formatting error , could you please follow the example code in here and let us know if this helps:&amp;nbsp;&lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_credentials" target="_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_credentials&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2024 04:25:32 GMT</pubDate>
    <dc:creator>Debayan</dc:creator>
    <dc:date>2024-01-18T04:25:32Z</dc:date>
    <item>
      <title>Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/56873#M30672</link>
      <description>&lt;P class=""&gt;Good Evening,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am configuring databricks_mws_credentials through Terraform on AWS.&amp;nbsp; I am getting the following error:&lt;/P&gt;&lt;P class=""&gt;Error: cannot create mws credentials: invalid Databricks Account configuration&lt;BR /&gt;│&lt;BR /&gt;│ with module.databricks.databricks_mws_credentials.this,&lt;BR /&gt;│ on modules/aws-databricks-tf/main.tf line 128, in resource "databricks_mws_credentials" "this":&lt;BR /&gt;│ 128: resource "databricks_mws_credentials" "this" {&lt;BR /&gt;│&lt;BR /&gt;&lt;BR /&gt;I have checked my account username, password and account-ID which are all correct. But i am getting the same error. Anything i am missing&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Below is my code:&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;resource "databricks_mws_credentials" "this" {&lt;/P&gt;&lt;P class=""&gt;#provider = databricks.mws&lt;/P&gt;&lt;P class=""&gt;account_id = var.databricks_account_id&lt;/P&gt;&lt;P class=""&gt;# role_arn = aws_iam_role.cross_account_role.arn&lt;/P&gt;&lt;P class=""&gt;role_arn = var.databricks_role_arn&lt;/P&gt;&lt;P class=""&gt;credentials_name = var.databricks_credentials&lt;/P&gt;&lt;P class=""&gt;# depends_on = [aws_iam_role_policy.this]&lt;/P&gt;&lt;P class=""&gt;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;module "databricks" {&lt;/P&gt;&lt;P class=""&gt;source = "./modules/aws-databricks-tf"&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;region = var.region&lt;/P&gt;&lt;P class=""&gt;databricks_vpc_id = element(data.aws_vpcs.vpc_list.ids, 0)&lt;/P&gt;&lt;P class=""&gt;databricks_subnet_ids = data.aws_subnets.subnet_ids_private.ids # Private Subnet 1/2&lt;/P&gt;&lt;P class=""&gt;databricks_security_group_ids = [aws_security_group.databricksNode-sg.id]&lt;/P&gt;&lt;P class=""&gt;env = var.env&lt;/P&gt;&lt;P class=""&gt;databricks_account_username = "my-username"&lt;/P&gt;&lt;P class=""&gt;databricks_account_password = "mypassword"&lt;/P&gt;&lt;P class=""&gt;databricks_account_id = "account-id"&lt;/P&gt;&lt;P class=""&gt;databricks_root_storage_bucket = "root-bucket"&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;# cross_account_iam_role = "DatabricksRole"&lt;/P&gt;&lt;P class=""&gt;databricks_role_arn =&amp;nbsp;my-databricks-role&amp;nbsp;# Instead of creating the Databricks Role via terraform, I have created it manually in the UI with relevant policies and trust relationship&lt;/P&gt;&lt;P class=""&gt;databricks_credentials = "DatabricksCredentials"&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;#aws #terraform #Credentials #error&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 16:24:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/56873#M30672</guid>
      <dc:creator>MYB24</dc:creator>
      <dc:date>2024-01-10T16:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57638#M30845</link>
      <description>&lt;P&gt;Hi, Looks like formatting error , could you please follow the example code in here and let us know if this helps:&amp;nbsp;&lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_credentials" target="_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_credentials&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 04:25:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57638#M30845</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2024-01-18T04:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57743#M30892</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/26078"&gt;@Debayan&lt;/a&gt;, this code was working before. i had deleted the mws credential file from my cloudformation stack and wnated to create a new one. when i tried to create a new mws credential and link it to a new workspace it would give me the above error. I have provided the whole file below which create the mws credential and workspace&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;resource "aws_kms_key" "this" {&lt;BR /&gt;enable_key_rotation = true&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;resource "aws_s3_bucket" "root_storage_bucket" {&lt;BR /&gt;bucket = var.databricks_root_storage_bucket&lt;BR /&gt;force_destroy = true&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "aws_s3_bucket_server_side_encryption_configuration" "s3_bucket_encryption" {&lt;BR /&gt;bucket = var.databricks_root_storage_bucket&lt;/P&gt;&lt;P&gt;rule {&lt;BR /&gt;apply_server_side_encryption_by_default {&lt;BR /&gt;kms_master_key_id = aws_kms_key.this.arn&lt;BR /&gt;sse_algorithm = "aws:kms"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;resource "aws_s3_bucket_versioning" "root_bucket" {&lt;BR /&gt;bucket = var.databricks_root_storage_bucket&lt;/P&gt;&lt;P&gt;versioning_configuration {&lt;BR /&gt;status = "Enabled"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "aws_s3_bucket_ownership_controls" "root_boot_ownership" {&lt;BR /&gt;bucket = var.databricks_root_storage_bucket&lt;BR /&gt;rule {&lt;BR /&gt;object_ownership = "BucketOwnerPreferred"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "aws_s3_bucket_acl" "root_bucket_acl" {&lt;BR /&gt;depends_on = [aws_s3_bucket_ownership_controls.root_boot_ownership]&lt;/P&gt;&lt;P&gt;bucket = var.databricks_root_storage_bucket&lt;BR /&gt;acl = "private"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "aws_s3_bucket_logging" "root_bucket_logging" {&lt;BR /&gt;bucket = var.databricks_root_storage_bucket&lt;/P&gt;&lt;P&gt;target_bucket = var.logging_target_bucket&lt;BR /&gt;target_prefix = var.logging_target_prefix&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "aws_s3_bucket_public_access_block" "root_storage_bucket" {&lt;BR /&gt;bucket = aws_s3_bucket.root_storage_bucket.id&lt;BR /&gt;block_public_acls = true&lt;BR /&gt;block_public_policy = true&lt;BR /&gt;ignore_public_acls = true&lt;BR /&gt;restrict_public_buckets = true&lt;BR /&gt;depends_on = [aws_s3_bucket.root_storage_bucket]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;data "databricks_aws_bucket_policy" "this" {&lt;BR /&gt;bucket = aws_s3_bucket.root_storage_bucket.bucket&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "aws_s3_bucket_policy" "root" {&lt;BR /&gt;bucket = aws_s3_bucket.root_storage_bucket.id&lt;BR /&gt;policy = &amp;lt;&amp;lt;POLICY&lt;BR /&gt;{&lt;BR /&gt;"Version": "2012-10-17",&lt;BR /&gt;"Statement": [&lt;BR /&gt;{&lt;BR /&gt;"Effect": "Allow",&lt;BR /&gt;"Principal": {&lt;BR /&gt;"AWS": "arn:aws:iam::account-id:root"&lt;BR /&gt;},&lt;BR /&gt;"Action": [&lt;BR /&gt;"s3:GetObject",&lt;BR /&gt;"s3:GetObjectVersion",&lt;BR /&gt;"s3:PutObject",&lt;BR /&gt;"s3:DeleteObject",&lt;BR /&gt;"s3:ListBucket",&lt;BR /&gt;"s3:GetBucketLocation"&lt;BR /&gt;],&lt;BR /&gt;"Resource": [&lt;BR /&gt;"arn:aws:s3:::${var.env}databricks/*",&lt;BR /&gt;"arn:aws:s3:::${var.env}atabricks"&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;POLICY&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;resource "databricks_mws_networks" "this" {&lt;BR /&gt;provider = databricks.mws&lt;BR /&gt;account_id = var.databricks_account_id&lt;BR /&gt;network_name = var.databricks_network_name&lt;BR /&gt;vpc_id = var.databricks_vpc_id&lt;BR /&gt;subnet_ids = flatten(var.databricks_subnet_ids)&lt;BR /&gt;security_group_ids = var.databricks_security_group_ids&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "databricks_mws_storage_configurations" "this" {&lt;BR /&gt;provider = databricks.mws&lt;BR /&gt;account_id = var.databricks_account_id&lt;BR /&gt;bucket_name = aws_s3_bucket.root_storage_bucket.bucket&lt;BR /&gt;storage_configuration_name = var.databricks_root_storage_bucket&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;resource "databricks_mws_credentials" "this" {&lt;BR /&gt;#provider = databricks.mws&lt;BR /&gt;account_id = var.databricks_account_id&lt;BR /&gt;# role_arn = aws_iam_role.cross_account_role.arn&lt;BR /&gt;role_arn = var.databricks_role_arn&lt;BR /&gt;credentials_name = var.databricks_credentials&lt;BR /&gt;# depends_on = [aws_iam_role_policy.this]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# resource "databricks_mws_workspaces" "this" {&lt;BR /&gt;# provider = databricks.mws&lt;BR /&gt;# account_id = var.databricks_account_id&lt;BR /&gt;# aws_region = var.region&lt;BR /&gt;# workspace_name = var.workspace_name&lt;BR /&gt;# # deployment_name = var.workspace_name&lt;/P&gt;&lt;P&gt;# credentials_id = databricks_mws_credentials.this.credentials_id&lt;BR /&gt;# storage_configuration_id = databricks_mws_storage_configurations.this.storage_configuration_id&lt;BR /&gt;# network_id = databricks_mws_networks.this.network_id&lt;BR /&gt;# }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 12:00:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57743#M30892</guid>
      <dc:creator>MYB24</dc:creator>
      <dc:date>2024-01-18T12:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57796#M30918</link>
      <description>&lt;P&gt;Managed to fix the issue by updating the provider.tf while. Had to create a Service Principle token and add that into my provider.tf file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt; &lt;SPAN&gt;"databricks"&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;alias&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"accounts"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;host&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;A href="https://accounts.cloud.databricks.com" target="_blank"&gt;https://accounts.cloud.databricks.com&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;client_id&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"service-principle-id"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;client_secret&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"service-principle-secret"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"databricks-account-id"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;BR /&gt;reference:&amp;nbsp;&lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs#special-configurations-for-aws" target="_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs#special-configurations-for-aws&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Jan 2024 16:49:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/57796#M30918</guid>
      <dc:creator>MYB24</dc:creator>
      <dc:date>2024-01-18T16:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/69981#M33955</link>
      <description>&lt;P&gt;just to add a context for probably the underlying issue requiring an account level service principal (with OAuth).&lt;/P&gt;&lt;P&gt;I experienced the same issue while using username and password as in the case how TF provider was configured for existing workspaces created prior to 11/2023.&amp;nbsp; Looks like Databricks is expecting/enforcing an account level service principal for TF provider for&amp;nbsp;new workspaces after 11/23.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 14:24:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/69981#M33955</guid>
      <dc:creator>TMD</dc:creator>
      <dc:date>2024-05-20T14:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/80986#M36186</link>
      <description>&lt;P&gt;Hello, I'm facing a similaire Issue. I try to update my TF with properly authentification and I have this error ?!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;╷
│ Error: cannot create mws credentials: failed visitor: context canceled
│ 
│   with databricks_mws_credentials.this,
│   on main.tf line 8, in resource "databricks_mws_credentials" "this":&lt;/LI-CODE&gt;&lt;P&gt;How you add context and what it is ?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 14:48:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/80986#M36186</guid>
      <dc:creator>Alexandre467</dc:creator>
      <dc:date>2024-07-29T14:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error: cannot create mws credentials: invalid Databricks Account configuration</title>
      <link>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/81679#M36393</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" href="https://community.databricks.com/t5/user/viewprofilepage/user-id/114123" target="_self"&gt;Alexandre467,&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Not sure what your&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;issue i&lt;/SPAN&gt;&lt;SPAN&gt;s.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;The reference to "context" in my earlier reply was referring to the situation as described in the second paragraph.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If you add a little bit of details as to what you have configured and the issue, then I can comment on:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;FYI, here're the workspace and account level provider configs as examples. Please pay attention to the Databricks Terraform provider documentation as to which one you need for the resource you are trying to deal with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;provider "databricks" {
  # Accunt Level resources such as workspaces
  alias         = "mws"
  host          = var.databricks_host     // https://accounts.cloud.databricks.com
  account_id    = var.databricks_account_id
  client_id     = var.databricks_tfe_client_id
  client_secret = var.databricks_tfe_client_secret
}

provider "databricks" {
  # workspace level but using account level credential
  alias         = "databricks-ws"
  host          = var.databricks_domain_for_workspace    // https://xyz-ws_name.cloud.databricks.com
  client_id     = var.databricks_tfe_client_id
  client_secret = var.databricks_tfe_client_secret
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 17:42:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-cannot-create-mws-credentials-invalid-databricks-account/m-p/81679#M36393</guid>
      <dc:creator>TMD</dc:creator>
      <dc:date>2024-08-02T17:42:42Z</dc:date>
    </item>
  </channel>
</rss>

