microsoft / jupyter-Kqlmagic

Extension (Magic) to Jupyter notebook and Jupyter lab, that enable notebook experience working with Kusto, ApplicationInsights, and LogAnalytics data.
Other
85 stars 31 forks source link

Running kqlmagic in a python script. #73

Closed amaljithkuttamath closed 3 years ago

amaljithkuttamath commented 3 years ago

expectation: is to use kql function in a python script.

from Kqlmagic import kql

kql("""appinsights://appid='xxx'; appkey='xxx'; alias='xxx' """)
page_view = f'''pageViews '''

kql(page_view).to_dataframe())

This works, however, is there a way to suppress the popup schema message (html) after authentication ?

opens in file location _C:/Users/xxx/kqlmagic/tempfiles/xxx/xxx/xxx.html

lesleyxyz commented 3 years ago

I am also wondering this, using Kqlmagic doesn't seem to have an easy way to use in regular python, which is weird because how else would I integrate this in business applications

mbnshtck commented 3 years ago

yes, you can set 'auto_popup_schema' option to false. Either with the environment variable KQLMAGIC_CONFIGURATION="auto_popup_schema=False" or when calling kql method set it to False kql("""appinsights://appid='xxx'; appkey='xxx'; alias='xxx' """, options={"auto_popup_schema": False})

amaljithkuttamath commented 3 years ago

Thank you @mbnshtck,

However, My use-case mostly is around Application Insights, Fortunately I found this REST-API implementation by Microsoft, (saved my day) Application Insights RESTAPI

Just leaving it out here, for anyone with a similar use-case.