How do i embed Azure data explorer dashboards on a web page

Domnic Christy Bakkianathan 5 Reputation points Microsoft Employee
2024-01-23T02:02:37.6233333+00:00

Hi All, I had followed the article at https://learn.microsoft.com/en-us/azure/data-explorer/kusto/api/monaco/host-web-ux-in-iframe#related-content to try embedding an Azure data explorer dashboard on a web page (ASP.NET web app with aspx page). I am able to get the access token and was able to follow the instructions, The WEB UI for Azure data explorer loads on the iframe in the page, but however the dashboard does not load. It throws an unknown error. Am i missing anything here. Can you please help here.

 string dashboardId = "<my dashboardid>";
            string cluster = "<my cluster>";
            IConfidentialClientApplication app = ConfidentialClientApplicationBuilder
                .Create(_appid)
                .WithClientSecret(_secretvalue)
                .WithAuthority(new Uri(String.Concat("https://login.microsoftonline.com/", _TenantId)))
                .Build();
            string[] scopes = new string[] { $"https://api.kusto.windows.net/.default" };
            var result = app.AcquireTokenForClient(scopes).ExecuteAsync().Result;
            
            string accessToken = result.AccessToken;
          
            return $"https://dataexplorer.azure.com/dashboards/{dashboardId}?accessToken={accessToken}&f-IFrameAuth=true&f-UseMeControl=false";

Please find the error am seeing below. Any pointers would be greatly appreciated. Thanks for the helpScreenshot 2024-01-22 180132

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
487 questions
{count} vote