Skip to content

Instantly share code, notes, and snippets.

@rohit-lakhanpal
Created December 16, 2021 06:48
Show Gist options
  • Select an option

  • Save rohit-lakhanpal/152ad8b145b9a84e6763c5f7c611a425 to your computer and use it in GitHub Desktop.

Select an option

Save rohit-lakhanpal/152ad8b145b9a84e6763c5f7c611a425 to your computer and use it in GitHub Desktop.
Use this to embed Azure Data Explorer's Web UI within your application. Learn more at https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/monaco/host-web-ux-in-iframe.
<iframe
width="1000"
height="800"
src="https://dataexplorer.azure.com/clusters/my-app.eastus/databases?ibizaPortal=true"
title="Analytics"
frameborder="0"
allowfullscreen>
</iframe>
<script>
window.addEventListener("message", function (event) {
debugger;
if(event.origin == "https://dataexplorer.azure.com" &&
event.data.type == "getToken" &&
event.data.signature == "queryExplorer" &&
event.isTrusted){
event.source.postMessage({
"type": "postToken",
"message": "[Access token from Azure AD. See (https://gist.github.com/rohit-lakhanpal/ae40a82029ac15f561791290bd397fcf) to fetch token.]"
}, event.origin);
}
console.log(event);
},false);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment