quixotic
quixotic

Reputation: 1

VSCode Kqlmagic Authentication Errors

I am using Kqlmagic in a VSCode Jupyter notebook setting and everything has been working smoothly ... except the need for Device Code authentication upon execution of every individual notebook. I've been querying data in both ADX and Sentinel (LAW), and I would like to streamline the auth process.

Reading documentation and the output of %kql --help, there appears to an option for try_vscode_login. I'm hoping there can be an initial login step where all subsequent notebooks in the token's lifetime will not require additional authentication. I have attempted to authenticate to Azure using the bundled Microsoft extension, as well as the Azure Resources extension. But no matter how I seem to authenticate to my account, Kqlmagic authentication does not want to pull a token from VSCode and I am met with the following log entries:

_MyAadHelper::_get_vscode_token failed to get token - tenant: '123...'
No suitable token exists in cache. Let's get a new one from AAD.

The connection strings I've tried include variations of the following:

%kql AzureDataExplorer://code;alias='adx';tenant='123..';cluster='https://examplecluster.westus.kusto.windows.net';database='exampledb' -try_vscode_login

I've even tried setting try_vscode_login=True in KQLMAGIC_CONFIGURATION. I've tried so many variations of config settings and connection strings. I've also messed with try_azcli_login, but get the same result.

Has anyone had success running Kqlmagic in VSCode Jupyter without having to device code auth everytime they run a separate notebook? How are you authenticating in VSCode? Is there a better flow? Any insight would be greatly appreciated, thanks! FWIW, I'm running on MacOS and everything is updated (OS, VSCode, Jupyter/Kusto Notebooks extensions, Python libraries, etc.).

Upvotes: 0

Views: 72

Answers (0)

Related Questions