Forum Discussion
senthan
Mar 08, 2021Copper Contributor
loganalytics.io REST API Call
we can able retrieve the token and grant the permission but we unable to get the data from that token.
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?
- jamesmk23Copper ContributorI 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 - josevieirassjcCopper Contributor