cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to embed a databricks dashboard in an iframe when running on localhost?

SylvainW
New Contributor II

Hello!

I'm working on embedding one of our databricks dashboards into an iframe but even after adding localhost to the Approved domains list, I'm getting the message that embedding for this domain isn't possible (see below).

We need to be able to develop and test on localhost and not have to release to dev every time time we want to test something.

Does anyone have a work around for this?

Thanks!

SylvainW_0-1755638534643.png

 

 

5 REPLIES 5

Khaja_Zaffer
Contributor

Hello @SylvainW 

Good day!!

I think, Databricks does not allow localhost as an embedding domain. ( may be other can confirm this)

work around for you: 

1. Use a local tunnel / reverse proxy - Then add that temporary hostname (e.g.,https://ngrok(or)localtunnel ) to your Databricks Approved domains list. 

2. Use a dev subdomain- use dev.yourcomany.com in Databricks and whitelist

3. Skip iframe and use API calls - For testing rather than UI, you can fetch the dashboard data via the Databricks SQL/API and render it directly. (complex)

(open for other solutions)

SylvainW
New Contributor II

Hey @Khaja_Zaffer !

Really appreciate you getting back to me so quickly.

We were able confirm with databricks yesterday that it is indeed possible to host an iframe from localhost. We were able to get it working temporarily by allowing access from any domain. That's clearly not a long term fix and we're working with them to figure out the exact configuration.

Thanks again for the fast reply!

Cheers,

Sylvain

 

WiliamRosa
New Contributor II

Hi @SylvainW 

Databricks does have restrictions on embedding domains for security reasons, and localhost is typically not allowed for embedding due to security concerns. This is a common practice to prevent potential security vulnerabilities.

One workaround you can consider is to use a tool that creates a secure tunnel to your localhost, allowing you to expose your local server to the internet with a secure URL. 

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

SylvainW
New Contributor II

Hey @WiliamRosa

Databricks has actually confirmed that we can embed in an iframe running on localhost and that it's just a matter of getting the right settings. We're working on that with them now (I'm not the direct contact with Databricks on my team so there's a lot of back and forth at the moment).

I'm curious about the tunnel thing though. If I'm understanding it right, I'd have to have an app running on my dev machine that would expose my localhost to the internet. That would used some kind fixed domain? Would there just be one domain exposed? Asking because how would this work if say 5 devs want to work on this from different machines.

Cheers,

Sylvain

SylvainW
New Contributor II

So for tunnelling, something like what is described here: https://dev.to/tahsin000/free-services-to-expose-localhost-to-https-a-comparison-5c19

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now