-
Notifications
You must be signed in to change notification settings - Fork 235
Open
Labels
TriageNew issue, yet to be triagedNew issue, yet to be triaged
Description
Bug Report: Cannot connect to Copilot Studio Agent using SDK sample
Language / Version
- Language: C# (.NET 8.0)
- Package Version: Microsoft.Identity.Client 4.63.1
- SDK Use: Agents SDK — Copilot Studio Client Sample
Agent Hosting Details
- Hosting: Local development (on-prem)
- Deployment Target: N/A (running console client sample)
- Azure Bot Services: No
- Client Type: Console Client (from GitHub sample)
- .NET Runtime: .NET 8.0
Describe the Bug
When attempting to connect the Copilot Studio Client to an agent environment using the provided SDK sample, authentication fails with AADSTS7000218 (“client_assertion or client_secret missing”) followed by a subsequent 403 Forbidden when calling StartConversationAsync.
I’ve tested both:
- User Login (AD) — using MSAL interactive login
- Service-to-Service (S2S) — using App registration and secret
Both methods fail to authenticate or authorise the request to the Copilot Studio environment.
Error Details
Exception 1 – Authentication
Microsoft.Identity.Client.MsalServiceException:
A configuration issue is preventing authentication.
Original exception: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.
Exception 2 – Agent Connection
System.Net.Http.HttpRequestException:
Error sending request: Forbidden.
Config Used
"CopilotStudioClientSettings": {
"DirectConnectUrl": "",
"EnvironmentId": "[REDACTED]",
"SchemaName": "[REDACTED]",
"TenantId": "[REDACTED]",
"AppClientId": "[REDACTED]",
"AppClientSecret": "[REDACTED]"
}To Reproduce
-
Clone the repo:
git clone https://github.com/microsoft/Agents cd samples/dotnet/copilotstudio-client -
Update
appsettings.jsonwith environment and Azure AD details. -
Attempt to run the console client and connect using:
- User interactive login, or
- App registration + Client Secret (S2S).
-
Observe the authentication failure followed by a
403 Forbiddenerror when the app calls:await foreach (Activity act in copilotClient.StartConversationAsync(...))
Expected Behaviour
The SDK should successfully:
- Authenticate using either user login or app registration (S2S).
- Establish a connection to the Copilot Studio hosted agent.
- Begin streaming messages from the Copilot Agent into the console client.
Screenshots
1. Authentication error (AADSTS7000218)
2. Forbidden error (403) during StartConversationAsync
Additional Context
- The same app registration credentials successfully authenticate against Microsoft Graph, so the Azure AD configuration is valid.
- The issue seems specific to the Copilot Studio Client SDK flow.
- It’s unclear if the SDK sample requires a specific redirect URI, App Role Assignment, or API permission scope setup that differs from documented guidance.
Metadata
Metadata
Assignees
Labels
TriageNew issue, yet to be triagedNew issue, yet to be triaged