Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databricks_token resource cannot create token for Azure China #434

Closed
summershyuan opened this issue Dec 7, 2020 · 3 comments · Fixed by #437
Closed

databricks_token resource cannot create token for Azure China #434

summershyuan opened this issue Dec 7, 2020 · 3 comments · Fixed by #437

Comments

@summershyuan
Copy link

Hello, there

I am using "datatbricks_token" resource to create a pat on Azure China by using the code block as below. I need to use this token to call Databricks APIs for '.jar' file uploading.

// create PAT token to provision entities within workspace
resource "databricks_token" "pat" {
  provider = databricks.created_workspace
  comment  = "Terraform Provisioning"
  // 100 day token
  lifetime_seconds = 8640000
}

However, i get "Terrafom Apply" error showing as below:
2020-12-02T07:12:43.7416770Z �[1m�[31mError: �[0m�[0m�[1mazure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/bd97bf5e-c392-4dd2-8b8f-f2d64ae34395/resourceGroups/rg-szh2-pm-store2staging-dev/providers/Microsoft.Databricks/workspaces/db-szh2-pm-store2staging-dev?api-version=2018-04-01: StatusCode=400 -- Original Error: adal: Refresh request failed. Status Code = '400'. Response body: {"error":"invalid_request","error_description":"AADSTS90002: Tenant '6a596574-1518-4214-840e-216bb42592e7' not found. This may happen if there are no active subscriptions for the tenant. Check to make sure you have the correct tenant ID. Check with your subscription administrator.\r\nTrace ID: 78ab0cfe-6af7-47c6-a632-a9830e400e00\r\nCorrelation ID: d215e6e8-6fa7-45f7-a191-f7d15ec3f1ac\r\nTimestamp: 2020-12-02 07:12:40Z","error_codes":[90002],"timestamp":"2020-12-02 07:12:40Z","trace_id":"78ab0cfe-6af7-47c6-a632-a9830e400e00","correlation_id":"d215e6e8-6fa7-45f7-a191-f7d15ec3f1ac","error_uri":"https://login.microsoftonline.com/error?code=90002"}�[0m 2020-12-02T07:12:43.7419836Z

I suspect, it is due to my tenant ID is from Azure China, but by default, it takes me to authenticate using Azure Global urls. I read through the documentation but cannot find a setting to configure the Azure Environment as China. My 'ARM_ENVIRONMENT' has been set as 'china'; but this seems having no impact here.

Can anyone tell me how i can use this "databricks_token" resource for Azure China? Many thanks!

@nfx
Copy link
Contributor

nfx commented Dec 7, 2020

Currently azure auth doesn’t work yet for azure china and azure govcloud. Pull requests are welcome:)

@nfx
Copy link
Contributor

nfx commented Dec 7, 2020

It’s literally the same issue as in #391

@nfx
Copy link
Contributor

nfx commented Jan 29, 2021

@summershyuan feature is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants