Closed Expecho closed 2 years ago
wasn't able to replicate the issue, works ok for me. Please send me what version of Kqlmagic you are using and log files (see instructions below) Possible reason you get this error:
You can enable logging by setting the LOG environment variables before you load Kqlmagic. The logs may provide insight why it fails:
%env KQLMAGIC_LOG_LEVEL=DEBUG
%env KQLMAGIC_LOG_LEVEL=
pls send me the log filename if you need more help on this
I think I can reproduce the problem.
I am using Azure Data Studio notebook to query the data. Initially I tried to connect using %kql loganalytics://code;workspace='xxx';alias='yyy'
but that fails:
KqlError: {"error":{"message":"The provided authentication is not valid for this resource","code":"InvalidTokenError","correlationId":"d76ff529-1b43-4122-aeae-6dbec9db5465","innererror":{"code":"InvalidAuthenticationTokenTenant","message":"The access token is from the wrong issuer '
Then I changed to
%kql loganalytics://username='<username>';password='<password>';workspace='<workspace-id>';alias='<workspace-friendly-name>'
Which gives an error
invalid connection string: loganalytics://username='xxx';password='yyy';workspace='zzz';alias='www', missing keys.
But when I close Azure Data Studio and reopen the notebook it works. It seems something goes wrong if you decide to change the way you authenticate while being in a single session.
So, according to the docs and example one should be able to connect using the username/password like this:
But as soon as I try that I get the following error:
What is up with that?