Skip to content

fix: Enable ActivityProtocol on newly created Foundry ChatAgent so it can be called from Copilot Studio - #78

Merged
Yamini Dhiman (Yamini1-Microsoft) merged 1 commit into
microsoft:mainfrom
jordanbean-msft:jordanbean-msft/foundry-agent-activityprotocol
Aug 7, 2026
Merged

fix: Enable ActivityProtocol on newly created Foundry ChatAgent so it can be called from Copilot Studio#78
Yamini Dhiman (Yamini1-Microsoft) merged 1 commit into
microsoft:mainfrom
jordanbean-msft:jordanbean-msft/foundry-agent-activityprotocol

Conversation

@jordanbean-msft

Copy link
Copy Markdown
Contributor

Purpose

This pull request enhances the agent setup process in the AI Foundry infrastructure scripts by adding support for enabling the Activity protocol and required authorization schemes on agent endpoints. This makes the agents compatible with Microsoft Copilot Studio and improves integration flexibility. The changes are primarily focused on protocol enablement, code organization, and minor refactoring for readability.

This is required to allow Copilot Studio to call the Foundry Agent since newly created Agents do not enable the ActivityProtocol by default in Foundry.

Otherwise, you get a "400 Agent ChatAgent endpoint does not support activity. Please update the agent endpoint to support this protocol." error when you try to call the ChatAgent from the Copilot Studio agent.

Agent protocol and authorization enhancements:

  • Added a new function enable_activity_protocol in agent_api.py to configure the Activity and Responses protocols, as well as required authorization schemes, for an agent endpoint. This allows Microsoft Copilot Studio to communicate with the agent using the Activity protocol.
  • Updated the agent setup workflow in step_agent_setup.py to call enable_activity_protocol after creating the agent and MCP connection, ensuring endpoints are properly configured.
  • Updated the module-level docstring in agent_api.py to document the new protocol and authorization enablement step.

Code organization and refactoring:

  • Imported enable_activity_protocol in step_agent_setup.py to make the new protocol configuration function available.
  • Minor formatting and line-break improvements in step_agent_setup.py for better readability.
  • Minor formatting improvement in create_kb_mcp_connection for better readability.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the ChatAgent gets correctly created in Foundry & that you can call it from Copilot Studio without receiving a "400 Agent ChatAgent endpoint does not support activity. Please update the agent endpoint to support this protocol."

Other Information

I used the REST API directly for enabling the ActivityProtocol since using the Python SDK would require incrementing the pinned version of azure-ai-projects from 2.1.0 to 2.3.0.

https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/configure-agent?tabs=rest#enable-protocols-and-authorization-schemes

@jordanbean-msft

Copy link
Copy Markdown
Contributor Author

Seth Steenken (@sethsteenken) as discussed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the AI Foundry agent provisioning step to ensure newly created agents have the Activity protocol (and related endpoint authorization configuration) enabled, making the agent callable from Microsoft Copilot Studio.

Changes:

  • Adds an enable_activity_protocol() helper in foundry/agent_api.py that patches the agent endpoint protocol/authorization configuration via REST.
  • Calls enable_activity_protocol() from setup_agent() after agent creation to ensure the endpoint is configured immediately.
  • Minor readability/formatting refactors in step_agent_setup.py and create_kb_mcp_connection().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
infra/scripts/foundry/step_agent_setup.py Invokes the new endpoint-configuration step after creating the agent.
infra/scripts/foundry/agent_api.py Introduces REST-based endpoint patching to enable Activity protocol + auth schemes (and minor formatting tweaks).

Comment thread infra/scripts/foundry/agent_api.py
Comment thread infra/scripts/foundry/agent_api.py
@Yamini1-Microsoft

Copy link
Copy Markdown
Contributor

Seth Steenken (@sethsteenken) as discussed

Hi Jordan Bean (@jordanbean-msft) Seth Steenken (@sethsteenken) We are currently validating the changes and will update you shortly.

@Yamini1-Microsoft
Yamini Dhiman (Yamini1-Microsoft) merged commit bf507b3 into microsoft:main Aug 7, 2026
3 of 4 checks passed
@jordanbean-msft
Jordan Bean (jordanbean-msft) deleted the jordanbean-msft/foundry-agent-activityprotocol branch August 10, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants