How to authorized Logic App to run KQL query

Disha Bodade 75 Reputation points
2024-03-04T06:59:46.73+00:00

I created a logic app to run on recurrence trigger. it was working fine when I configured it, now today its showing Authorization Failed error for run KQL & list results Action. This action was also previously working fine.

{
  "ResultStatus": "Forbidden",
  "Content": {
    "error": {
      "code": "AuthorizationFailed",
      "message": "/providers/Microsoft.OperationalInsights/workspaces/soc-corp-cyber-ws' or the scope is invalid. If access was recently granted, please refresh your credentials."
    }
  },
  "Message": "Failed to get HTTP response because of invalid input (ARM, queryData). Failed to get valid response. Not Authorized. Error Code=Forbidden\r\nclientRequestId: 3183c0b2-41ae-4931-a495-1fbbe836e579"
}

}Please let me know what is wrong with the settings.

Thanks!!

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,078 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 26,151 Reputation points
    2024-03-11T13:49:10.3866667+00:00

    @Disha Bodade I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! I'll repost your solution in case you'd like to "Accept" the answer.

    Issue: Logic App was failing to authorize with the ARM API.

    "error": { "code": "AuthorizationFailed",
     "message": "/providers/Microsoft.OperationalInsights/workspaces/soc-corp-cyber-ws' or the scope is invalid. If access was recently granted, please refresh your credentials."     }

    Solution: The issue was related to the Security Administrator role not being enabled in Azure Privileged Identity Management (PIM). PIM is a service in Azure that allows you to manage access to resources in your organization. By enabling the Security Administrator role in PIM, you were able to grant the necessary permissions to the Logic App to access the API.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.