Forum Discussion
Krishna1994
Jun 20, 2024Copper Contributor
Unable to retrieve query data using Log Analytics API
I have been trying to access Azure KQL data with the help of Log Analytics REST API, the connection is successful showing a 200 response but I am only getting the table headers and not getting any da...
Kidd_Ip
Jan 24, 2025MVP
Please check on below:
- Permissions: Ensure that the credentials you're using have the necessary permissions to access the data in the Log Analytics workspace. You might need to verify the roles and permissions assigned to the service principal or user account.
- Query Syntax: Double-check the KQL query syntax to ensure it's correct and that it should return data. You can test the query directly in the Log Analytics portal to see if it returns results there.
- API Endpoint: Make sure the API endpoint and query parameters are correctly set up. Sometimes, appending the query string directly in the URL can help.
- Data Availability: Verify that there is data available within the specified timespan. If there's no data, the query will return an empty table.
- API Version: Ensure you're using the correct version of the Log Analytics API. Sometimes, updates or changes to the API might require adjustments in the code.