Databricks Apps not working in postman

arun_prakash
New Contributor

I have a question regarding Databricks Apps. I have deployed my databricks Apps, and its working on my laptop, but when I try to open the same url in my mobile its redirecting to databricks signin page, and also its not working through postman as well. Can somebody help here?

Walter_C
Databricks Employee
Databricks Employee

Is this issue specifically with the Databricks Apps am I right? Are you getting and erro message?

Hello @Walter_C , how to access databricks app, like a get or post request from PostMan, I created an api and it works from browser but I want it to work from postman or any other coding platform, like a normal request method?

 

The solution is to provide a Bearer token, which should be generated using the Databricks Apps Service Principal (Client ID and Client Secret).

Also, make sure your API endpoints use the /api prefix.

You can follow the official documentation here for more details:
https://apps-cookbook.dev/docs/fastapi/getting_started/connections/connect_from_external

The token generated this way expires in 3600 seconds (1 hour).
If but I need a long-lasting token for IoT devices. Is there any way to do this ??

Hello @Punit_Prajapati - is this something which we can use to invoke the app from a notebook within the same workspace? And how about when we have multiple apps deployed? How is the databricks_client_id and databricks_client_secret saved? do we have to append the app name ? I get 401 when i follow this article using the saved clientid and secret. The Service Principal does have "Can Use" on the deployed app.