Forum Discussion

senthan's avatar
senthan
Copper Contributor
Mar 07, 2021

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?

3 Replies

  • jamesmk23's avatar
    jamesmk23
    Copper Contributor
    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
  • komal_g's avatar
    komal_g
    Copper Contributor

    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 -