Forum Discussion
senthan
Mar 07, 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 a...
jamesmk23
Jul 08, 2022Copper 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
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