Publish the Agent to Teams and Microsoft 365 Copilot
Lab overview
An agent that only lives in the Foundry portal isn't finished. In this lab, you register the Microsoft.BotService resource provider that publishing requires, publish contoso-helpdesk-agent to Teams and Microsoft 365 Copilot with a name, description, and publish scope, and confirm the Azure Bot resource that was created. You then open the agent's web app and ask it a policy question the way a help desk analyst would, with none of the builder controls in view.
Why you'd do this
Help desk staff don't live in the Foundry portal, and they shouldn't have access to it. They live in Teams. Publishing is what moves the agent from the place it was built to the place it will be used: Foundry wraps it in an Azure Bot resource, which is the plumbing that lets Teams and Microsoft 365 Copilot talk to it, and exposes it as a named app with a description and a version. Everything you built in the previous eleven labs is still there underneath; this lab just gives it a front door.
The resource provider step is the kind of thing that stops people cold on a real subscription. Azure services are gated by providers, and a new subscription has most of them unregistered; publishing an agent needs Microsoft.BotService, and if it isn't registered the publish wizard fails with an error that doesn't explain why. Registering it is a one-time, subscription-wide action, and knowing to look there is worth more than the thirty seconds it takes.
Two choices in the wizard matter. The active version you confirm first is what users will reach: Latest means every save in lab 10 and beyond flows straight to Teams, which is convenient in a lab and risky in production, where you'd pin a version and promote deliberately. The publish scope is the blast radius. Just you is the right default for a first publish, because the next step up, People in your organization, puts the agent in front of everyone at once; in a real rollout you'd test with yourself, then with the help desk group from lab 10, then widen.
The final test is the one that counts. Opening the preview web app and asking a policy question as a plain user, with no instructions box, no tool list, and no trace view, is the first time the agent is experienced the way the help desk will experience it. The 120-day answer arriving outside the portal, grounded and cited, is the project working end to end. For certification prep, deploying and publishing agents to channels and managing the Azure resources behind an AI solution are AI-103 objectives, and the Foundry implementation material is in AI-901.
Lab details
- Agent:
contoso-helpdesk-agent, active version Latest (version 4) - Resource Provider:
Microsoft.BotServiceregistered on the subscription - Published App:
Contoso IT Helpdesk, version 1.0.0, developer Contoso IT - Publish Scope: Direct publish, Just you
- Created: Azure Bot resource in
rg-contoso-assistant - End-User Test: Preview web app, password expiration policy question
Learning objectives
- Register an Azure resource provider and explain why a subscription needs one.
- Publish a Foundry agent to Teams and Microsoft 365 Copilot and choose a publish scope.
- Identify the Azure Bot resource that publishing creates and what it does.
- Test a published agent as an end user through its web app.
Exam relevance
- AI-901 — Microsoft Azure AI Fundamentals — implement AI solutions by using Microsoft Foundry.
- AI-103 — Developing AI Apps and Agents on Azure — deploy and publish agents to channels; manage Azure resources that support AI solutions.
How this lab fits into the project
This is lab 12 of 12 in the Contoso Knowledge Assistant project. Contoso's IT help desk fields the same policy questions all day, so over this series you've built an AI agent that answers them from the company's own documents, then grounded it, secured it, evaluated it, and monitored it. This final lab puts the agent where the help desk actually works, by publishing it to Teams and Microsoft 365 Copilot and testing it as an end user.
Step-by-step instructions
- Confirm the active version:
- In the Foundry portal, click Build, then click
contoso-helpdesk-agenton the Agents page. - Click the Details tab.
- Under Agent configuration, note that the Active version is set to Latest. The active version is what users reach through the published agent.
- In the Foundry portal, click Build, then click
- Register the Bot Service resource provider:
- Click the Azure portal browser tab and click your subscription.
- Expand Settings in the left pane and click Resource providers.
- Type
Microsoft.BotServicein the filter box and select its row. - Click Register and wait for the success message.
- Click Refresh and confirm the status changed to Registered.
- Describe the agent:
- Click the Foundry portal browser tab.
- Click the Publish dropdown and select Teams and Microsoft 365 Copilot.
- Note that an Azure Bot Service resource is created automatically.
- Double-click the default agent name and type
Contoso IT Helpdesk. - Accept
1.0.0as the Publish version. - Type
Answers questions about Contoso IT policies.as the Short description. - Click the Online Notepad browser tab, press Ctrl+A, then Ctrl+C.
- Click the Foundry portal browser tab, click the Description field, and press Ctrl+V to paste the full description.
- Type
Contoso ITas the Developer and click Next: Publish options.
- Choose who can use the agent:
- Ensure the Direct publish tab is selected.
- Under Choose who can use this agent, note the two options: Just you and People in your organization.
- Accept the default selection of Just you and click Publish.
- Note the Publish successful confirmation and click Done.
- Verify what was created:
- On the Details page, note the channels listed in the Channels section.
- Click the Azure portal browser tab, click Home, then Resource groups, then
rg-contoso-assistant. - Note the new Azure Bot resource in the list.
- Test the agent as an end user:
- Click the Foundry portal browser tab and view the Channels section on the Details tab.
- On the Preview web app card, note the Active status and that people with Azure RBAC permissions can access it.
- Click the Open web app button.
- In the chat box, type
What is Contoso's password expiration policy?and click send. - Note the grounded answer of 120 days, delivered outside the Foundry portal.
- Click the Foundry portal browser tab to return.