cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

API for Databricks code functionality

AJ270990
Contributor II

I have a Databricks notebook for which I want to create an API. From that API I will have to call the notebook and perform certain operations. Result will be sent back to API. I dont want to do via Postman, as someone has to install Postman at their end. Can I create that API in Azure or something else ?

3 REPLIES 3

Kaniz_Fatma
Community Manager
Community Manager

Hi @AJ270990 , 

You can create an API in Azure to call the Databricks Notebook using Azure Functions.


- Steps to follow:


 1. Create an Azure Function in Azure portal.
 2. Write code in the function to call the Databricks notebook using Databricks REST API.
 3. Use the jobs/run-now endpoint of Databricks REST API to run the notebook.
 4. Send back the results from the notebook as a response from the Azure Function.


- A personal access token is required in Databricks to authenticate your API calls.

Thank you.. can you tell me how can I access the Databricks notebook here ? I am using Databricks Session URL, Token and the SQL Query. I am using requests.post() and within that I am passing all these information to get the response which would be json file.

Kaniz_Fatma
Community Manager
Community Manager

Hi @AJ270990 , Thank you for posting your question in our community! We are happy to assist you.

 

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

 

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!