Error 403 while executing query using resoure URI

Abhi 0 Reputation points
2023-11-02T06:23:25.5866667+00:00

I have enabled diagnostic agent and storing l the metrics data in a storage. My focus is to use KQL query rest api and fetch the disk related details. So i am using the below mentioned Rest API -

GET https://api.loganalytics.io/v1/{resourceId}/query?query={query}

But i am getting 403 error, stating that given credentials do not have access to read logs for this resource. The details of error are -

error":{"message": "The provided credentials have insufficient access to perform the requested operation","code":"InsufficientAccessError", "correlation Id":"xxxx", "innererror": {"code":"AuthorizationFailedError", "message": "Given credentials do not have access to read logs for this resource"}}}

Although i have already enabled data.read permission and reader role.

And I am able to run the below rest api using same credentials, but i want to use above mentioned rest api-

GET https://api.loganalytics.io/v1/workspaces/{workspaceId}/query?query={query}

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,256 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
631 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.