Others

Fix Microsoft Graph API Access Denied Error in Console Applications

Elise WilliamsElise Williams Nov 4, 2026 868 views

Question details

The user needs to resolve an 'access denied' error when attempting to read messages through the Microsoft Graph API using a confidential console application.

How to Fix Microsoft Graph API Access Denied Error for Console Applications
Product
Microsoft Graph API
Device & OS
not provided
Scenario
Using a client ID, tenant ID, and client secret to authenticate a confidential console application for reading messages.
Observed behavior
The application returns an access-denied error despite having authentication credentials configured.
Before you start

Ensure you have administrator access to the Azure Active Directory (Azure AD) admin center for the tenant where the application is registered, as you will need to verify app permissions.

Solution 1Recommended

Verify Application Permissions and Grant Admin Consent

Confidential console applications (daemon apps) run without a signed-in user, meaning they require 'Application' permissions and active administrator consent in Azure AD to access resources.

When using the client credentials flow (client ID and secret), the application cannot rely on delegated permissions. If the app only has delegated permissions configured, or if admin consent hasn't been granted for the application permissions, the Microsoft Graph API will reject requests with an access denied error.

1
Navigate to Azure AD App Registrations

Log in to the Azure Portal, search for 'Microsoft Entra ID' (formerly Azure Active Directory), select it, and click on 'App registrations' from the left sidebar.

2
Open Your Console Application

Locate and select the specific console application you have registered to open its overview page.

3
Configure Application Permissions

Click on 'API permissions' under the Manage menu. Click 'Add a permission', choose 'Microsoft Graph', and then specifically select 'Application permissions'. Check the necessary permissions for your task (e.g., Mail.Read).

4
Grant Admin Consent

After adding the permissions, click the 'Grant admin consent for [Your Tenant Name]' button located above the permissions list. Confirm the action, and ensure a green checkmark appears in the status column.

Verify Application Permissions and Grant Admin Consent
Wait for Propagation: After granting admin consent, it may take a few minutes for the new permissions to propagate through the Microsoft Graph system before your application can successfully authenticate.
Free Microsoft Office alternative

Switch to WPS Office for a Seamless Productivity Experience

While resolving backend Microsoft Graph API configurations, you still need a reliable tool for your daily document management. WPS Office offers a free, highly compatible alternative to Microsoft Office, letting you create and edit documents, spreadsheets, and presentations with ease.

  1. 1. Visit the Official Website: Go to the official WPS Office website to find the correct version for your operating system.
  2. 2. Install the Software: Download the lightweight installer, run it, and follow the simple on-screen instructions.
  3. 3. Open Microsoft Formats Instantly: Launch WPS Office and directly open your existing .docx, .xlsx, or .pptx files with full formatting retention.
Highly compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight architecture that runs smoothly on Windows, Mac, Linux, and mobile devices.Familiar, tabbed user interface ensuring a zero-learning-curve transition.Built-in PDF reader and editor for comprehensive document workflows without extra software.
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between Delegated and Application permissions in Microsoft Graph?

Delegated permissions require a signed-in user context and are typically used for desktop or web apps. Application permissions are used by background services or console applications running without a user context, and they strictly require administrator consent.

Why does my console app return 'Access Denied' even with a valid access token?

This usually happens if the generated access token lacks the necessary scopes (permissions) to perform the intended action. It can also occur if Application permissions were added in Azure AD but the 'Grant admin consent' button was never clicked by an administrator.

How do I check if my client secret has expired in Azure AD?

Go to your app registration in the Microsoft Entra ID (Azure Portal), select 'Certificates & secrets' from the left menu, and check the expiration date of your current client secret. If it has expired, generate a new client secret and update the credentials in your console application.