web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - Model Context Protocol
Suggested Answer

Entra Auth for MCP Server Custom Connector

(1) ShareShare
ReportReport
Posted on by
ustomerHi all,

We're working with a con a project that is a top priority for them. It involves deploying an MCP server on Container Apps and a chat interface. They're evaluating options for the interface, but we think a Copilot agent makes the most sense. I'm trying to use your Copilot Studio MCP lab as a POC and everything works as expected following the steps you provide, but the customer has a firm requirement for Entra auth on the container app and I'm struggling to get that working with the custom connector. 

What I've tried following already:

Lab MCS5 - Consuming a custom connector - Copilot Developer Camp
 

https://learn.microsoft.com/en-us/azure/container-apps/authentication-entra#-option-2-use-an-existing-registration-created-separately

Any assistance you could provide with this would be greatly appreciated. The project has high visibility and a fairly tight timeline.
 
Thanks!
I have the same question (0)
  • Suggested answer
    Sam_Fawzi Profile Picture
    720 Super User 2025 Season 2 on at
    Entra Auth for MCP Server Custom Connector
     
    Thanks for sharing the details—this is a great use case 

    Key Considerations
    1. Container App Authentication
      When you enable Entra auth on Container Apps, the app is protected by Azure AD. Any incoming request must include a valid Bearer token issued by Entra.
    2. Custom Connector Authentication
      The connector needs to acquire a token from Entra and attach it to requests. This usually involves:
      • Registering an App Registration in Entra.
      • Configuring the connector with OAuth 2.0 settings (Authorization URL, Token URL, Client ID, Secret, Scopes).
      • Ensuring the resource URI matches the Container App’s protected endpoint.
    3. Copilot Studio Connector Behavior
      Copilot Studio supports OAuth 2.0 for custom connectors, but the tricky part is aligning the connector’s token acquisition with the Container App’s expected audience.

    Recommended Steps
    1. App Registration
    • Create an App Registration in Entra for the Container App.
    • Note the Client ID, Tenant ID, and Client Secret.
    • Under Expose an API, set the Application ID URI (e.g., api://<your-app-id>).
    • Add required permissions (usually user.read or custom scopes).
    2. Enable Authentication on Container App
    • In Azure Portal → Container App → Authentication, select Microsoft Entra ID.
    • Use the App Registration created above.
    • Ensure the redirect URI matches what Copilot Studio expects (usually https://global.consent.azure-apim.net/redirect for connectors).
    3. Configure Custom Connector
    • In Copilot Studio:
      • Auth type: OAuth 2.0
      • Authorization URL: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize
      • Token URL: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
      • Scope: api://<your-app-id>/.default
      • Resource: api://<your-app-id> (if required)
    • Test the connector to ensure token acquisition works.
    4. Validate Audience
    • The Container App will validate the audience claim in the token. Make sure the token’s aud matches the App ID URI you set in Expose an API.

     Common Pitfalls
    • Mismatch in redirect URI → Connector won’t complete OAuth flow.
    • Wrong scope → Token doesn’t include required permissions.
    • Audience mismatch → Container App rejects token.

    let me know if you need help with any of the above. 
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 304 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 224 Super User 2025 Season 2

#3
Sam_Fawzi Profile Picture

Sam_Fawzi 78 Super User 2025 Season 2

Last 30 days Overall leaderboard