cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
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>
7 REPLIES 7

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
Contributor III

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!