Facing CORS issue while calling Databricks REST API from a react application
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 03:41 AM
I am trying to call the REST API of Databricks from a React(v17) application, using the following documentation https://docs.databricks.com/api/workspace/introduction .
I am getting CORS issue on the APIs and not able to call them. But, when I try to call them through an intermediate node server, that I have setup, its working fine.
To be more specific, I tried to execute a query on one of the tables using the statement execution APIs, https://docs.databricks.com/api/workspace/statementexecution
Is there a way to call the APIs directly from the React(v17) application ? Or is there a way to bypass the CORS issue ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 01:55 PM
There was a similar issue resolved regarding cors seen here: https://community.databricks.com/t5/administration-architecture/databricks-rest-apis-cors-issue/td-p...
If this is just for your own development and testing you might consider allowing all in your react app but be careful of monitoring outside malicious requests with such a setting