Summary:
I’m trying to fetch group calendar and its events using Azure application-only permissions, but I’m getting an error.
Error Message:
Error Message Image
Code:
var graphClient = new GraphServiceClient(authProvider); var events = await graphClient .Groups[groupId] .Calendar .Events .Request() .GetAsync();
- Ensured the application has the required permissions (Calendars.Read, Calendars.ReadWrite,
Group.ReadWrite.All) in the Azure portal. - Verified the client credentials (client ID, tenant ID, client secret) are correct.
- Checked that the application is granted admin consent for the required permissions.
Question:
What could be causing the ErrorAccessDenied when trying to fetch the group calendar events with application-only permissions? How can I resolve this issue?
Additional Information:
- The application is registered in Azure AD and has been granted admin consent for the necessary permissions.
- I’m using the Microsoft Graph SDK for .NET.
- The application works correctly for other API calls (e.g., fetching user details).
Any help or pointers would be appreciated!
CodeSeeker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.