Setting up Direct Line
Calibrant uses the Direct Line channel to send test queries to your Copilot Studio agent during optimization runs. You need to enable the channel and copy its secret key.
Step 1: Enable the Direct Line channel
- Go to copilotstudio.microsoft.com and open your agent.
- Click Channels in the left sidebar.
- Find Direct Line in the channel list.
- Toggle it on if it isn't already enabled.
Step 2: Get the secret key
From the Azure Portal (recommended)
- Go to portal.azure.com.
- Search for "Azure Bot" in the top bar.
- Select the bot resource for your Copilot Studio agent.
- Click Channels in the left nav.
- Click on Direct Line (or add it if not listed).
- Click Show next to either secret key and copy it.
From Copilot Studio
- Open your agent in Copilot Studio.
- Go to Settings → Channels → Direct Line.
- Copy the secret key shown.
Step 3: Verify it works
Test the secret by starting a conversation via the Direct Line API:
curl -X POST \
https://directline.botframework.com/v3/directline/conversations \
-H "Authorization: Bearer YOUR_SECRET_HERE" \
-H "Content-Type: application/json"A 201 Created response with a conversationId means the secret is valid. A 401 means the secret is wrong or the channel isn't enabled.
Troubleshooting
Can't find the Azure Bot resource
Copilot Studio auto-provisions it in a Microsoft-managed resource group. You may need Azure subscription owner permissions to see it. Try searching by the bot's name.
Direct Line returns 403 Forbidden
The channel may be disabled or the bot's messaging endpoint is misconfigured. Check the Azure Bot resource → Configuration → verify the messaging endpoint URL.
Do I need both secret keys?
No — just one. Azure provides two so you can rotate without downtime. Give Calibrant either one.
Next steps
With both the Agent ID and Direct Line secret, you're ready to register your agent in Calibrant.