Chat UI Setup
The Gradio chat UI authenticates against Copilot Studio using MSAL interactive login. You need an Entra ID App Registration and a .env file with your agent details.
App Registration
- Go to portal.azure.com > App registrations > New registration
- Name: e.g., “MCP Demo Chat Client”
- Supported account types: Single tenant
- Redirect URI: Public client/native >
http://localhost - After creation, go to API permissions > Add a permission > APIs my organization uses
- Search for CopilotStudio > select CopilotStudio.Copilots.Invoke (delegated)
- Click Grant admin consent
- Copy the Application (client) ID — this is your
AGENTAPPIDbelow
Configure .env
Copy chat-ui/.env.sample to chat-ui/.env and fill in:
COPILOTSTUDIOAGENT__ENVIRONMENTID=<your-environment-id>
COPILOTSTUDIOAGENT__SCHEMANAME=<agent-schema-name>
COPILOTSTUDIOAGENT__TENANTID=<your-tenant-id>
COPILOTSTUDIOAGENT__AGENTAPPID=<app-registration-client-id>
| Variable | Where to find it |
|---|---|
ENVIRONMENTID |
The GUID in your Power Platform URL, or Settings > Session details in Copilot Studio |
SCHEMANAME |
Copilot Studio > open the Orders Agent > Settings > Advanced > Schema name |
TENANTID |
Your Entra ID tenant ID (Azure Portal > Microsoft Entra ID > Overview) |
AGENTAPPID |
The Application (client) ID from the App Registration above |