You are developing a background daemon service named ConfigSync that runs as a containerized application in Azure Container Instances. The service must periodically query Microsoft Graph to read tenant group memberships to synchronize configurations. No user is signed in when the service runs.
You register the application in Microsoft Entra ID. You need to configure the API permissions for the application registration while adhering to the principle of least privilege.
Which configuration should you implement?
- Add Microsoft Graph Application permissions for GroupMember.Read.All, and have a global administrator grant admin consent.Answer
- BAdd Microsoft Graph Delegated permissions for GroupMember.Read.All, and request an access token using the client credentials flow.
- CAdd Microsoft Graph Application permissions for Group.Read.All, and configure the application to prompt the container instance for interactive consent at runtime.
- DAdd Microsoft Graph Delegated permissions for Group.Read.All, and request an access token using the resource owner password credentials (ROPC) flow with a service account.
Answer
Add Microsoft Graph Application permissions for GroupMember.Read.All, and have a global administrator grant admin consent.
The service runs as a background daemon without any user signed in, which dictates the use of the client credentials flow and Microsoft Graph Application permissions. To follow the principle of least privilege, GroupMember.Read.All should be chosen over Group.Read.All because it limits access strictly to reading memberships rather than full group properties. Application permissions always require a global administrator to grant admin consent.
Step-by-Step Solution
Key Concept
Microsoft Entra ID Application permissions and Client Credentials flow for background daemon services