API permissions in app registration control what external services an app can access
When you register an app in Azure Active Directory, you define which APIs it can call and what level of access it has. These permissions must be granted by an administrator before the app can use them.
- Permission types Delegated and application permissions
- Grant required Admin consent for most sensitive permissions
- Scope format API name + permission name like User.Read
Choose the Right Permission Type
When you add an API permission in an app registration, you select either delegated or application permission. Delegated permissions act on behalf of a signed-in user. The app inherits the user’s rights. Application permissions act as the app itself, with no user involved. These are used for background services or daemon apps.
For example, if your app reads a user’s email, you use delegated permission Microsoft Graph User.Read. If your app runs nightly to process all company emails without user input, you use application permission Mail.Read.All.
Delegated permissions are safer because they are limited by the user’s role. Application permissions are more powerful and require stricter controls. Never choose application permissions unless your app truly runs without a user context.
Add Permissions Through the App Registration Portal
Go to the Azure portal, open Azure Active Directory, then App registrations. Select your app, then API permissions. Click Add a permission. You’ll see a list of APIs: Microsoft APIs, My APIs, Commonly used APIs, and Enterprise applications.
For Microsoft Graph, select Microsoft Graph. Then choose the category: Delegated permissions or Application permissions. Scroll or search for the specific permission you need. Common ones include User.Read, Calendars.Read, Files.Read, Directory.Read.All, and Group.Read.All. Click Add permissions.
Each permission has a description. Read it. For example, Directory.Read.All allows reading all directory data, including users, groups, and device objects. If you only need to read basic profile info, User.Read is enough. Avoid over-requesting permissions.
Admin Consent Is Not Optional
Adding a permission does not activate it. The app still cannot use it until someone with administrative rights grants consent. This step blocks unauthorized apps from accessing sensitive data.
In the API permissions list, you’ll see a status column. A confirmation dialog appears. Confirm it. This action applies to the entire organization.
If you are not a global administrator, you cannot grant consent. You must request it from someone who has the role. Some permissions, like User.Read, may allow user consent if the app is configured for it. But most enterprise permissions require admin consent by default.
Common Mistakes in Permission Configuration
Many developers assume that adding a permission gives immediate access. It does not. The most common error is forgetting admin consent. The app works in development but fails in production because no admin approved it.
Another mistake is using application permissions when delegated would work. For example, an app that displays a user’s calendar might request Calendar.Read.All (application) instead of Calendars.Read (delegated). This exposes all calendars in the organization, which is unnecessary and risky.
Some apps request too many permissions at once. They add User.Read, Mail.Read, Files.Read, Group.Read.All, and Directory.Read.All in a single step. This raises red flags during security reviews. Request only what you need. Test with minimal permissions first.
Also, permission names can change. User.Read was once called User.ReadBasic. Always check the current name in the Azure portal. Do not copy old documentation.
Test Permissions Before Deployment
After adding and granting permissions, test the app with the same account that will use it in production. Use a test user account that has the same role as real users. Try the exact operation the app performs.
If you get a 403 Forbidden error, check the permissions list again. Did you grant admin consent? Is the permission type correct? Is the API endpoint you’re calling compatible with the permission? For example, User.Read works with /me endpoint. Directory.Read.All works with /users endpoint.
Use the Microsoft Graph Explorer to test permissions independently. Sign in with the same account, select the permission, and run a sample request. If it works in Graph Explorer but not your app, the issue is in your code or token request.
Verify Permissions with Token Claims
The access token your app receives contains claims that list granted permissions. Decode the token at jwt.io to see them. Look for the scp claim (scope). It shows the exact permissions granted, like User.Read Mail.Read.
Compare this list with what you requested. If a permission is missing, consent was not granted. If you see unexpected permissions, your app may have been granted more than intended. Revisit the app registration and remove unused permissions.
For application permissions, the roles claim replaces scp. It shows roles like Mail.Read.All. These are not user-scoped. They apply to the app identity.
Permissions for Third-Party APIs
Apps can also request permissions for third-party APIs registered in Azure AD. These appear under My APIs or Enterprise applications. The process is the same: add the permission, then grant admin consent.
For example, if your app uses Salesforce or ServiceNow via their Azure AD integration, you add their API, select the required scope, and grant consent. The scope format is usually {tenant}/{api}/{permission}. Check the third-party’s documentation for exact names.
Security Best Practices
Follow the principle of least privilege. Only request permissions your app needs to function. Review permissions quarterly. Remove unused ones.
Use conditional access policies to restrict which users or devices can use apps with high-risk permissions. Require multi-factor authentication for users accessing sensitive data.
Log permission changes. Use Azure Monitor or Azure Activity Log to track who added or removed permissions in your app registration. Set alerts for new admin consent grants.
When to Use Delegated vs Application Permissions
Use delegated permissions when:
- The user is present and signed in
- The app acts on the user’s behalf
- You need to respect the user’s access rights
Use application permissions when:
- The app runs without user interaction
- It’s a background service, daemon, or scheduled task
- It needs to access data across the organization
There is no performance difference. The choice is about security and scope.
API Permissions for Large Tenants and Multiple Environments
In large organizations, permissions are often managed centrally. Developers request permissions through a ticketing system. The security team reviews them before granting consent.
Use separate app registrations for development, testing, and production. Never grant admin consent in production until the app is fully tested in lower environments. Use Azure AD App Proxy or conditional access to restrict access to test apps.
For multi-tenant apps, request permissions that are common across tenants. Avoid tenant-specific scopes unless necessary. Test with different tenant types: commercial, government, education.
Frequently Asked Questions
Can users grant consent themselves?
Only for delegated permissions marked as user-consent friendly. These are low-risk permissions like User.Read or profile access. Admins can disable user consent in Azure AD settings. Always assume admin consent is required unless confirmed otherwise.
What happens if I delete a permission?
Deleting a permission revokes access immediately. Any token issued with that scope becomes invalid. The app will fail on the next API call. Update your code to remove references to the permission before deleting it.
Why does my app work in Postman but not in my code?
Postman may use a token from a different app registration or a different user account. Check the token claims in your code’s response. Compare the scope or roles to what you expect. Ensure your code requests the correct scope in the OAuth flow.
Do I need to renew API permissions?
No. Permissions remain active until removed. However, if the API changes its permission model, you may need to update your app registration. Monitor Microsoft Graph and third-party API changelogs.
Can I limit permissions to specific users or groups?
No. Permissions apply to the entire app registration. To restrict access, use conditional access policies or application roles. Assign roles to users or groups in Enterprise Applications, then check the role claim in your app.
Further reading: Microsoft Learn