cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting HTML sign I page as api response from databricks api with statuscode 200

TestuserAva
New Contributor II
Response:
<!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" />
    <script id="__databricks_react_script"></script>
    <script>
        window.__DATABRICKS_SAFE_FLAGS__={"databricks.infra.showErrorModalOnFetchError":true,"databricks.fe.infra.useReact18":false},window.__DATABRICKS_CONFIG__={CONFIG_PLACEHOLDER_KEY:null}
    </script>
    <link rel="icon" href="/favicon.ico">
    <script defer="defer" src="/static/js/login/login.0a88c09b.js"></script>
</head>

<body class="light-mode">
    <uses-legacy-bootstrap>
        <div id="login-page"></div>
    </uses-legacy-bootstrap>
</body>
 
TestuserAva_0-1701165195616.png

 


</html>
12 REPLIES 12

Abhishek10745
New Contributor III

Even i am receiving the same.

I have performed following steps:
1. created SP on Azure.
2. Granted contributor role on azure resource where DBx workspace is created.
3. Gerated token using, az account get-access-token --resource 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d.
4. Used this token as bearer token for calling DBx create token api.
5. But in the response i get status code as 200 and html code.

In my scenario i am calling a powershell inline script in azure ci pipeline. Also i tried to replicated the same process via postman, i revceive the same error.

Note: If i use all the above information and execute the command locally on power shell, it works fine and returns me token.

feiyun0112
Honored Contributor

you need set DATABRICKS_TOKEN  in header

 

curl --request GET "https://${DATABRICKS_HOST}/api/2.0/clusters/get" \
     --header "Authorization: Bearer ${DATABRICKS_TOKEN}" \
     --data '{ "cluster_id": "1234-567890-a12bcde3" }'

Databricks REST API reference

Abhishek10745
New Contributor III

Hello @feiyun0112 ,
Thanks for the response. I am already using header in my cURL call and also i tried following command using power shell.

Invoke-WebRequest -Uri "https://$databricksWorkspaceUrl/api/2.0/token/create" -Body ($json | ConvertTo-Json) -ContentType "application/json" -Method Post -Headers $headers
This works fine when i trigger using local powershell cli but fails when i trigger using azure CI pipelines or postman

Abhishek10745
New Contributor III

@TestuserAva
Can you please share your approach to tackle this problem in case if you solved.
For me it works using powershell Invoke-WebRequest but not using postman.

SJR
New Contributor III

Hey all! I'm having the exact same problem. Did you manage to make it work @Abhishek10745 @TestuserAva ?
Could you please share the solution if you did? Thanks!

Abhishek10745
New Contributor III

Hello @SJR ,
In the scenario which i mentioned in the previous comment, my ci pipeline was using a pool or scaleset which did not have access to this azure databricks service. Hence, when my service principal tried to create PAT token using databricks api (running on incorrect scaleset / pool) , it did not allow me to login hence i could not perform any operation using databricks api.

When i used the correct scaleset/pool  which was give access to this azure databricks service, it worked.

Hope this helps you to investigate in correct direction.

SJR
New Contributor III

Hello @Abhishek10745 

It was just like you said! We have a completely private instance of Databricks and the DevOps Pipeline that I was using didin't have access to the private vnet. Switching pools solved the problem. Thanks for all the help!

schunduri
New Contributor II

Hi @Abhishek10745 or @SJR ,

I am having exact problem and our databricks workspace is under Vnet. Can you please explain the process of switching pools?

Hello @schunduri ,

Probably your DevOps team might have dedicated scaleset or clusters that must have permission on your vnet.

In CI pipeline try to use the name of that scaleset created by ur DevOps.

In my case our cloud flavour was Azure that is why I am using word scaleset on which CI pipelines run.

Regards,

Abhishek Kalekar 

Thank you @Abhishek10745 , We are also using Azure DevOps and Azure Databricks. I will check with our internal DevOps team.

SJR
New Contributor III

Hey @schunduri, not entirely sure because our SRE did the change, but the machine the pipeline runs on must be within the same vnet as your DBKS workspace. 

If you need more guidance, I could try and check what we did but our SRE left the company since then and it's been a while.

Let me know and best of luck!

schunduri
New Contributor II

Thank you @SJR for a quick response. I would really appreciate if you could find the details.

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group