loganalytics.io REST API Call

Copper Contributor
we can able retrieve the token and grant the permission but we unable to get the data from that token.
image (2).png

 

image (1).png

 

we encountered this issue below

HTTP Exception:
The remote server returned an error: (403) Forbidden. Error Type Reason: Forbidden, Detailed Message: "error":"message":"The provided authentication is not valid for this resource","code":"InvalidTokenError","correlationId":"691cfa6f-acbb-4923-8583-4a1a6593c174","innererror":"code":"InvalidTokenError","message":"Could not validate the request. Challenge failed: SignatureVerificationFailed"

"error": 
"message": "The provided authentication is not valid for this resource",
"code": "InvalidTokenError",
"correlationId": "691cfa6f-acbb-4923-8583-4a1a6593c174",
"innererror": 
"code": "InvalidTokenError",
"message": "Could not validate the request. Challenge failed: SignatureVerificationFailed"

can you please able to assist me about this issue?
3 Replies

@senthan good morning!

 

did you manage to solve your problem? I'm having the same problem!

@senthan Did you get any help on this ?

I am also facing the similar issue - trying to connect log analytics workspace from azure data factory getting the similar error - 

komal_g_1-1652092126751.png

 

I managed to run query on log analytics using Azure data factory
Refer to this.
https://docs.microsoft.com/en-us/rest/api/loganalytics/dataaccess/query/get

My token is requested from
https://login.microsoftonline.com/<aadtenantid>/oauth2/token using these parameters
1) app registration ClientID/Secret.
2) resource = https://api.loganalytics.io
Additionally app registration should be assigned Log Analytics Workspace - Log Analytics Reader role

My query example is
https://api.loganalytics.io/v1/workspaces/<workspaceid>/query?query=Event |limit 5