I am stuck on step 2.4 of this wiki
In the previous step, I get a valid token.
Why do I get "Valid authentication was not provided"?
I added a header called Authorization - see picture.
What am i missing?
I am stuck on step 2.4 of this wiki
In the previous step, I get a valid token.
Why do I get "Valid authentication was not provided"?
I added a header called Authorization - see picture.
What am i missing?
I needed to do:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=<client id>&scope=https://api.loganalytics.io/.default&client_secret=<client secret>&grant_type=client_credentials' 'https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token'
to get this to work, i.e.:
POST /<your tenant id>/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=<>
&client_secret=<>
&scope=https://api.loganalytics.io/.default
I hope this helps someone :) It took way too long for me to figure this out lol.
When we use Azure Log Analytics REST API to do a query, we need to use
Authorization=Bearer eyJ....
as request Headers. For more details, please refer to here.For example
Register Azure AD application
Configure API permissions for the AD application
Give the AAD Application access to our Log Analytics Workspace. Please assign
Log Analytics Reader
role to the AD applicationGet access token