Forum Discussion

dbagwell's avatar
dbagwell
Regular Visitor
2 years ago
Solved

Embedding a Streamlit Web App into a Power BI Dashboard - Enable JavaScript

I am attempting to embed an Azure Web Service app (built using Streamlit) in a Power BI Dashboard.  I am using the HTML Content component.  I can successfully hit the Web Service App and render it correctly by calling it using Chrome and Edge browsers, so I believe the Web Service App is set up correctly. I am able to render other websites in the HTML Content components successfully, so I believe that is set up correctly also.  This is a POC dashboard, so to keep things simple, I have coded the <iframe> call in a calculated column in one of the tables in the data model.  I am using the sandbox attribute with "allow-same-origin".  It appears that we are getting most of the way with these settings, but the component is reporting:  "You need to enable JavaScript to run this app."

I have been unable to find any postings on this issue.  Is there a configuration piece somewhere that I have missed?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, dbagwell 

    The message "You need to enable JavaScript to run this app" typically indicates that JavaScript is either disabled or not supported in the environment where the app is trying to run.

    Make sure that the environment in which the Power BI dashboard is running supports JavaScript. For security reasons, Power BI itself doesn't execute JavaScript directly in visuals. However, custom visuals or embed options may provide some level of JavaScript support. Check out the following documentation, which includes information about Javascript&colon;

    Adding external libraries to Power BI visuals - Power BI | Microsoft Learn

     

    Embed a report in a secure portal or website - Power BI | Microsoft Learn

     

    Double-check the deployment settings for the Streamlit app in Azure Web Services. Make sure it's configured to allow embedding in other sites, especially when it comes to Content Security Policy (CSP) headers. These headers can limit the ability to embed an app into an iframe.

    When trying to load the Streamlit app in a Power BI dashboard, check your browser console for any specific errors or warnings that might provide a deeper understanding of what is preventing JavaScript from running. This can often provide clues about a security policy that is missing or is blocking enforcement.

    If you're embedding for your organization's use and you're facing limitations from HTML content components, exploring Power BI Embedded may provide a more flexible embedding solution. Power BI Embedded is designed for developers to embed analytics in their applications, and it may provide a more suitable environment for Streamlit app integration:

    Power BI embedded analytics overview - Power BI | Microsoft Learn

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, dbagwell 

    The message "You need to enable JavaScript to run this app" typically indicates that JavaScript is either disabled or not supported in the environment where the app is trying to run.

    Make sure that the environment in which the Power BI dashboard is running supports JavaScript. For security reasons, Power BI itself doesn't execute JavaScript directly in visuals. However, custom visuals or embed options may provide some level of JavaScript support. Check out the following documentation, which includes information about Javascript&colon;

    Adding external libraries to Power BI visuals - Power BI | Microsoft Learn

     

    Embed a report in a secure portal or website - Power BI | Microsoft Learn

     

    Double-check the deployment settings for the Streamlit app in Azure Web Services. Make sure it's configured to allow embedding in other sites, especially when it comes to Content Security Policy (CSP) headers. These headers can limit the ability to embed an app into an iframe.

    When trying to load the Streamlit app in a Power BI dashboard, check your browser console for any specific errors or warnings that might provide a deeper understanding of what is preventing JavaScript from running. This can often provide clues about a security policy that is missing or is blocking enforcement.

    If you're embedding for your organization's use and you're facing limitations from HTML content components, exploring Power BI Embedded may provide a more flexible embedding solution. Power BI Embedded is designed for developers to embed analytics in their applications, and it may provide a more suitable environment for Streamlit app integration:

    Power BI embedded analytics overview - Power BI | Microsoft Learn

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi,

     

    Did you manage to successfully embed a streamlit app in your Power BI Dashboard?

     

    Thanks