How to connect Custom Copilot Agent to Power Platform Model driven app ?

Olaf Chuszno 0 Reputation points
2025-12-03T17:23:54.3433333+00:00

I want to connect my Copilot Agent to my Model Driven App, however I’m having trouble acquiring the access token for Copilot agent (even when using a custom .NET backend).

I cannot use MSAL on the frontend (in model driven app) because it will introduce a login pop-up and Copilot doesn’t accept a service token.

Im open to any custom solution involving my backend, using a PCF or anything that will help me connect my app to Copilot.

I do not need any additional Authentication except for just connecting to the Copilot agent.

Microsoft Copilot | Microsoft Security Copilot
{count} votes

1 answer

Sort by: Most helpful
  1. Karan Shewale 2,210 Reputation points Microsoft External Staff
    2025-12-04T07:01:41.31+00:00

    Hi Olaf,

    Model-Driven Apps can’t silently create the Copilot Agent token, and MSAL on the client will always trigger a login popup. Copilot also doesn’t accept service tokens, so direct calls from the app aren’t supported.

    The workable approach is to route everything through a backend API. Your Model-Driven App calls your Azure Function/.NET API (via Custom Connector or PCF), the Dataverse user token is sent automatically, and your backend uses the On-Behalf-Of (OBO) flow to exchange that token for a Copilot Agent token. The backend then calls the Copilot Agent and returns the response to the app.

    This is the only clean and supported pattern to make the integration work.

    Reference Docs:

    1. OBO flow: Microsoft identity platform and OAuth 2.0 On-Behalf-Of flow
    2. Custom connectors: https://learn.microsoft.com/en-us/connectors/overview
    3. Copilot Agent API: https://learn.microsoft.com/en-us/microsoft-copilot-studio/agent-extend-action-rest-api

    Thank you.

    Karan Shewale.

    If this response resolves your issue, please Accept the answer and, if helpful, click the “Upvote” button. Your feedback helps us improve and assist others more effectively.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.