I’ve created a Teams app that runs on a backend Python service, where it:
- Receives an incoming request from a user.
- Starts background threads for processing.
- Sends back multiple adaptive card responses using the conversation ID.
- Handles authentication in the backend (Teams token flow working fine).
This works well when the app is used directly in Microsoft Teams.
I’ve added this app as a skill to Copilot Studio and I receive the initial request from Copilot successfully and i'm able to send a base response (i.e., the response to the POST request).
But when I try to send follow-up responses using the same conversation ID and service URL provided in the original Copilot request, I consistently get 401 Unauthorized or 403 Forbidden errors.
I suspect this is because I don’t have the correct auth token to post to the Copilot conversation.
My questions:
- How do I obtain the correct auth token (JWT/Bearer) that is accepted by Copilot Studio to send proactive messages back using the skill bot?
- What is the token audience (aud) and scopes I should be using for proactive messages to Copilot?
- Are there any special steps for setting up Bot Framework credentials or manifest settings specifically for Copilot skill bots?
Additional Details:
- Backend: Python (Flask)
- Sending responses using Bot Framework SDK methods and conversation_id + service_url from the incoming activity.
- This works fine for Teams, but not when triggered via Copilot.
Things Tried:
- Bot Framework docs on proactive messaging.
- Setting skill as per Copilot Studio documentation.
- Tried generating tokens using Azure AD App registration (Client credentials flow), but they fail to authenticate with Copilot.