Forum Discussion
Authenticate with client credentials - Log Analytics
- Sep 14, 2017
Hi Johan,
For the direct URL https://api.loganalytics.io, we will not currently be able to support client credentials. However, you are still able to call the API via an alternative URL.
For this method, the URL you direct requests at is
https://management.azure.com/subscriptions/{subscription}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/api/{area}?api-version=2017-01-01-preview&[queryParams]Where “area” is the endpoint you wish to hit (probably “query”), and queryParams are as usual for the Log Analytics API.
In this case you can use the client credentials grant as documented here. In the token request, set your resource to https://management.azure.com/ including the trailing slash. With this token against the ARM url above, you should be able to query successfully. Note that this is *not* the v2.0 endpoint as I had previously indicated.
Let me know if you have further questions or this does not resolve your issue.
Hi Ace,
Thank you for the reply and the support! Looking forward to an update :)
Hi Johan,
For the direct URL https://api.loganalytics.io, we will not currently be able to support client credentials. However, you are still able to call the API via an alternative URL.
For this method, the URL you direct requests at is
https://management.azure.com/subscriptions/{subscription}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/api/{area}?api-version=2017-01-01-preview&[queryParams]
Where “area” is the endpoint you wish to hit (probably “query”), and queryParams are as usual for the Log Analytics API.
In this case you can use the client credentials grant as documented here. In the token request, set your resource to https://management.azure.com/ including the trailing slash. With this token against the ARM url above, you should be able to query successfully. Note that this is *not* the v2.0 endpoint as I had previously indicated.
Let me know if you have further questions or this does not resolve your issue.
- Johan BSep 15, 2017Copper Contributor
Hi Ace,
Thanks a lot, the URL is working perfectly and resolved my issue!
Do you know if this URL will be supported long-term since client credentials won't be supported for the direct URL in the upcoming time?
Once again, thanks a lot!
Johan
- Ace EldeibSep 15, 2017Former Employee
This URL will continue to work. There are some differences in terms of routing to get to your data and limitations to the size of calls that can be made (for example the direct API can return a higher maximum row count), but for most cases the differences should not be significant.
Feel free to let me know if you have further questions.