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

Azure Managed Identity Support #95

Open ScratZa opened 2 years ago

ScratZa commented 2 years ago

Would be great to have an option to support Managed Identity

Is this something on the roadmap? if not happy to try my hand and contribute towards this.

OliverKleinBST commented 1 year ago

Actually it is supported, e.g.

import os os.environ['KQLMAGIC_CONFIGURATION'] = ( "extras_require=jupyter-basic,msi_sso,plotly;" "warn_missing_dependencies=False;" "notebook_app=jupyterlab;" "try_msi={'client_id':'...' };" ) %reload_ext Kqlmagic

There seems however to be a problem in Kqlmagic/my_aad_helper_msal.py. A hack to fix that could look like sed -i 's/time.localtime(token.get(OAuth2TokenFields.EXPIRES_ON))/time.localtime(int(token.get(OAuth2TokenFields.EXPIRES_ON)))/' my_aad_helper_msal.py sed -i 's/time.localtime(token.get(OAuth2TokenFields.NOT_BEFORE))/time.localtime(int(token.get(OAuth2TokenFields.NOT_BEFORE)))/' my_aad_helper_msal.py