Skip to main content

Publish agents to Microsoft 365 Copilot and Microsoft Teams

Use this article to publish a Microsoft Foundry agent so people can use it in Microsoft 365 Copilot and Microsoft Teams. Publishing creates an agent application with a stable endpoint and then prepares a Microsoft 365 publishing package for testing and distribution.

Prerequisites

  • Access to the Microsoft Foundry portal
  • A Foundry project with an agent version you tested and want to publish
  • The following role assignments:
  • An Azure subscription where you can create Azure Bot Service resources and Microsoft Entra ID app registrations
  • Permissions to register applications in Microsoft Entra ID (for the automatic app registration)

Before you begin

  • Test your agent thoroughly in the Foundry portal before publishing. Confirm it responds correctly and any tools work as expected.
  • If your agent uses tools that access Azure resources, plan to reassign any required permissions after publishing. A published agent application uses its own agent identity separate from your project identity. For details, see Agent identity concepts in Microsoft Foundry and Publish and share agents in Microsoft Foundry.
  • Decide whether you want Shared scope or Organization scope for distribution:
    • Shared scope: Best for personal or team-level testing. No admin approval required.
    • Organization scope: Best for organization-wide distribution. Requires admin approval before users can access it.
  • Verify that required Azure resource providers are registered in your subscription. The publishing process creates an Azure Bot Service resource, which requires the Microsoft.BotService provider.

Publish your agent as an agent application

To work programmatically, you can also use the C# sample.
  1. In the Microsoft Foundry portal, select your agent version. Expected result: The agent details page opens, showing the agent configuration and a Publish button.
  2. Select Publish to create an agent application.
Screenshot of the Publish option for an agent version in Microsoft Foundry.
Expected result: A publishing dialog opens with distribution options.
  1. Select Publish again, and then select Publish to Teams and Microsoft 365 Copilot. Expected result: The Microsoft 365 publishing configuration window opens.
  2. Enter the information in the window that appears.
    1. An application ID and tenant ID are created automatically. Note these values for troubleshooting.
    2. In the Azure Bot Service dropdown, select Create an Azure Bot Service to create the bot resource.
    Expected result: The portal creates an Azure Bot Service resource in your subscription and displays the resource name.
  3. Complete the required metadata:
    FieldDescription
    NameDisplay name for your agent (appears in the agent store)
    DescriptionBrief description of what your agent does
    IconsSmall (32x32) and large (192x192) icons in PNG format
    Publisher informationYour organization name and contact details
    Privacy policyURL to your privacy policy
    Terms of useURL to your terms of use
Don’t include secrets, API keys, or sensitive information in any metadata fields. These fields are visible to users.
  1. Select Prepare Agent to start packaging the agent. Expected result: The portal shows a progress indicator while it creates the Microsoft 365 publishing package. This process typically takes 1-2 minutes.
  2. When the Microsoft 365 publishing package is ready, choose one of the following options:
    • Download the package to test it locally before broad distribution.
    • Continue the in-product publishing flow for Microsoft Teams and Microsoft 365 Copilot.
    Verification: After the package is ready, confirm the status shows “Ready” or “Published” in the agent details page.

Choose a publish scope

Choose the scope that matches how you want people to discover your agent.
ScopeVisibilityAdmin approvalBest for
Shared scopeAppears under Your agents in the agent storeNot requiredPersonal testing, small teams, or pilots
Organization scopeAppears under Built by your org in the agent storeRequiredOrganization-wide distribution, production deployments
Screenshot of the agent store showing sections such as Your agents and Built by your org.

Shared scope details

  • The agent is available immediately after publishing.
  • Only the publisher can see and use the agent initially.
  • You can share the agent with specific users by providing them the agent link.
  • No admin approval or tenant configuration required.

Organization scope details

  • After you publish, an admin must approve the app in the Microsoft 365 admin center.
  • Once approved, the agent appears in the Built by your org section for all users in your tenant.
  • App policies in your tenant control which users can access the agent.
  • To check approval status, go to the Microsoft 365 admin center and look for your agent under Requests.

Download and test the publishing package

If you download the package, test it before broad distribution.
  1. After the package finishes preparing, download it from the publishing UI. Expected result: A .zip file downloads to your local machine.
  2. In Microsoft Teams, upload the downloaded package for testing:
    1. Open Microsoft Teams.
    2. Go to Apps > Manage your apps > Upload an app.
    3. Select Upload a custom app and choose the downloaded .zip file.
    Expected result: Teams installs the app and shows it in your apps list.
  3. Open the agent in Teams and send a test message. Verification checklist:
    • The agent responds to messages.
    • Any configured tools work correctly.
    • The agent identity has access to required Azure resources (if applicable).
    • Response times are acceptable.
  4. If your agent uses tools that access Azure resources, verify the published agent identity has the required role assignments. See Agent identity concepts in Microsoft Foundry for details on reassigning permissions.

Troubleshooting

Use these checks to unblock common publishing issues.
IssueCauseResolution
Azure Bot Service creation failsMissing permissions or unregistered resource providerConfirm you have permission to create resources in the selected Azure subscription. Register the Microsoft.BotService provider if needed.
Organization scope agent doesn’t appearAdmin approval pending or app policies block accessConfirm an admin approved the app in the Microsoft 365 admin center. Check that app policies in your tenant allow users to access it.
Agent works in Foundry but fails after publishingAgent identity missing required role assignmentsThe published agent uses its own identity. Reassign RBAC permissions to the new agent identity for any Azure resources the agent accesses. See Agent identity concepts.
Package upload fails in TeamsInvalid package format or missing metadataVerify all required metadata fields are complete. Re-download the package and try again.
Agent doesn’t respond in TeamsBot Service configuration issueVerify the Azure Bot Service resource is running. Check the Bot Service logs in the Azure portal for errors.
Users can’t find the agent in the storeWrong scope or approval pendingFor shared scope, share the direct link. For organization scope, confirm admin approval is complete.

Verify your publishing configuration

To confirm your agent is published correctly:
  1. In the Foundry portal, go to your agent and check the Published status.
  2. Note the Application ID and Tenant ID from the publishing details.
  3. In the Azure portal, verify the Azure Bot Service resource exists and is running.
  4. For organization scope, check the Microsoft 365 admin center for approval status.

Next steps