Thank you for your detailed post!
When walking through the Send-Teams-adaptive-card-on-incident-creation GitHub repo and testing the template that was deployed, I ran into the same permissions error. To hopefully help point you in the right direction, I'll share the troubleshooting steps I took to resolve the issue.
Error Message
Forbidden: The client '...5e59 with object id '...5e59' does not have authorization to perform action 'Microsoft.SecurityInsights/incidents/read' over scope '/subscriptions/....../incidents/c2243ad93967' or the scope is invalid....
- After reviewing the full error message, I double checked the connections that were deployed with the template and noticed that the
MicrosoftSentinel-Send-Teams-adaptive-card-on-incident-creation
API connection uses a Managed Identity. - Navigating to the
Send-Teams-adaptive-card-on-incident-creation
Logic App -> Identity, you should find that the Client ID and Object ID referenced within the error message is that of the Logic Apps' System Assigned Managed Identity. - Since the Playbook's Managed Identity doesn't have the correct permissions, I assigned the Microsoft Sentinel Responder role to it by selecting the
Azure role assignments
button. For more info.-
Note: I also noticed that the Post Deployment section of the GitHub repo also details the required Managed Identity permissions.
-
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.