Deploy a Foundry-hosted AI agent and onboard it into Microsoft Agent 365 with full enterprise governance β own Entra identity, license, audit trail, and threat protection.
β±οΈ ~15 minutes end-to-end | π³ No Docker required | β Verified April 10, 2026
Agent 365 is Microsoft's enterprise governance layer for AI agents. It doesn't build agents β it governs them.
graph LR
A[π€ Your Agent] --> B[π‘οΈ Agent 365 Governance]
B --> C[π Entra Agent ID]
B --> D[π Admin Center Registry]
B --> E[π Purview Audit]
B --> F[π‘οΈ Defender Threat Protection]
style B fill:#0078D4,color:#fff
Every onboarded agent gets:
| ποΈ Governance Pillar | Platform | What it does |
|---|---|---|
| π Identity | Entra ID | Own Agent ID, Conditional Access, Lifecycle Management |
| π Observability | M365 Admin Center | Registry, Agent Map, Ownerless Detection |
| π Data Protection | Purview | Audit trail, Sensitivity Labels, DLP |
| π‘οΈ Threat Defense | Defender | Risk Detection, Prompt Shield, Advanced Hunting |
| License | Purpose | Minimum |
|---|---|---|
| Microsoft 365 (Business Standard/Premium, E3, or E5) | Base plan | 1 |
| Microsoft 365 Copilot (add-on or bundle) | Enables Frontier access | 1 |
| Agent 365 Frontier Trial (25 licenses) | Assigned per agent instance | Activated in Step 1 below |
A
Business Standard + Copilotbundle is sufficient. E-licenses are not required.
| Requirement | Details |
|---|---|
| Subscription type | Pay-As-You-Go or Enterprise Agreement |
| Required role | Owner on the subscription |
| Region | Resources must be in North Central US (only region supporting Hosted Agents) |
| Resource | SKU | Estimated Cost |
|---|---|---|
| AI Services (Foundry Account) | S0 | Pay-per-use (GPT-4o: ~$2.50/1M input tokens) |
| Container Registry | Basic | ~$5/month |
| Bot Service | F0 (Free) | $0 |
| Hosted Agent Container | Managed by Foundry | Included in AI Services |
| Total (idle/demo) | ~$5-10/month + token usage |
For a demo or pilot with light usage, expect under $20/month. The main cost driver is GPT-4o token consumption.
| Permission | Who needs it | Why |
|---|---|---|
| Global Administrator (or Copilot Administrator) | Person running the setup | Enable Frontier, approve blueprints, manage licenses |
| Azure Subscription Owner | Person running azd provision |
Create Azure resources |
| Teams Administrator (optional) | Same or different person | Configure Teams Developer Portal |
For a pilot, one person with Global Admin + Subscription Owner can do everything.
winget install Microsoft.AzureCLI # Azure CLI
winget install Microsoft.Azd # Azure Developer CLI
winget install Microsoft.DotNet.SDK.9 # .NET 9.0 SDKDocker Desktop is NOT required. The deployment uses Azure Container Registry remote build.
Your tenant must be enrolled in the Frontier preview program. Frontier is available to all Microsoft 365 customers with a Copilot license.
- Open the M365 Admin Center
- Go to Copilot β Settings β User access
- Under Copilot Frontier β select All users β Save
Important
This step is easily missed. Without it, you get 0 licenses and agent creation will fail.
- In the Admin Center, go to Agents β Overview
- Look for the banner: "Do more with the Frontier Program"
- Click "Try Now"
- Verify: Go to Billing β Licenses β You should see 25 Γ Microsoft Agent 365 Frontier
Admin Center β Agents β Settings:
- β Allow apps and agents built by your organization
- User access: All users
# Sign in to Azure CLI (device code flow recommended)
az login --use-device-code --tenant YOUR-TENANT-DOMAIN
# Sign in to Azure Developer CLI
azd auth login --tenant-id YOUR-TENANT-IDUse
--use-device-codeif you have multiple browser profiles or accounts.
git clone https://github.com/microsoft-foundry/foundry-samples.git
cd foundry-samples/samples/csharp/FoundryA365Caution
This step is critical! The default sample includes MCP tools (OneDrive, Word) that require a KeyVault certificate. Without clearing this, the agent will crash silently when receiving messages.
# Replace the ToolingManifest with an empty configuration:
'{"mcpServers":[]}' | Set-Content src/hello_world_a365_agent/ToolingManifest.jsonYou can add MCP tools back later once KeyVault is configured.
azd provisionYou'll be prompted for:
| Prompt | What to enter |
|---|---|
| Subscription | Select your Azure subscription |
| Environment name | e.g. myagent (becomes the prefix for all resources) |
| Location | northcentralus |
| Resource group | Select "Create a new resource group" |
Note
That's it. This single command automatically:
- β Creates the Foundry Project, Container Registry, and Bot Service
- β Builds the container image remotely (no local Docker needed)
- β Creates the Agent Blueprint and starts the hosted container
- β Submits a Digital Worker request to the M365 Admin Center
- β Configures OAuth2 grants for the Blueprint
Duration: ~6 minutes.
azd env get-valuesCopy the value of AGENT_IDENTITY_BLUEPRINT_ID β you'll need it in the next step.
- Open: Admin Center β Agents β Requests
- Find your agent (name = your environment name from Step 2.4)
- Click "Approve request and activate"
- Select template: "Default template for allowing instances"
- Publish to: All users β Activate for: All users
- Accept the permissions β Click Finish
Warning
The agent will NOT receive messages in Teams without this step!
-
Open:
https://dev.teams.microsoft.com/tools/agent-blueprint/YOUR-BLUEPRINT-ID/configuration(Replace
YOUR-BLUEPRINT-IDwith the value from Step 2.5) -
Set Agent Type: Bot Based
-
Set Bot ID: = your Blueprint ID (same value!)
-
Click Save
Tip
If your blueprint doesn't appear in the portal list (it only shows 100), open any blueprint and replace the ID in the browser URL with yours.
- Open Microsoft Teams
- Go to Apps β search for your agent (environment name)
- Under "Agents for your team" β click your agent
- Click "Create agent" β enter a name (e.g. "My AI Assistant") β Create
- Wait for the notification (~1-2 minutes)
- Open the chat with your agent β type "Hello!"
Note
The agent will only respond in Microsoft Teams. DirectLine/WebChat testing is not supported for Foundry Hosted Agents.
At this point, your agent has:
- Has its own Entra Agent ID
- Has an Agent 365 license assigned (1 of 25)
- Is visible in the Admin Center Agent Registry
- Has Purview audit logging active
- Is monitored by Defender for Identity
- Is reachable via @mention in Teams
| Governance Area | Where to Show It |
|---|---|
| Agent Registry | Admin Center β Agents β All |
| Agent Map (visual overview) | Admin Center β Agents β Frontier tab |
| License Usage | Admin Center β Billing β Licenses |
| Security Assessment | Agent detail page β Security tab |
| Entra Agent Identity | Entra Admin Center β Agent Identities |
| Audit Trail | Purview β Audit |
| Threat Detection | Defender β Identities |
| Issue | Cause | Fix |
|---|---|---|
| "0 of 0 licenses available" when creating instance | "Agent 365 Tools" Service Principal missing in tenant | Run: Install-Module Microsoft.Graph; Connect-MgGraph -Scopes "Application.ReadWrite.All"; New-MgServicePrincipal -AppId "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1" |
| Agent not found in Teams Apps | Blueprint not yet approved or Dev Portal not configured | Complete Steps 3.1 and 3.2, wait 2 minutes |
| Agent doesn't respond in Teams | Container not running or ToolingManifest has MCP tools without KeyVault | Check Foundry Portal; set ToolingManifest to {"mcpServers":[]} before deploy |
| Blueprint not visible in Dev Portal | Portal only shows first 100 blueprints | Manually enter the blueprint URL with your ID |
azd provision fails with region error |
Wrong region selected | Must use northcentralus |
| Frontier not visible in Admin Center | No Copilot license | Purchase at least 1 Microsoft 365 Copilot license |
To remove all Azure resources when done:
cd foundry-samples/samples/csharp/FoundryA365
azd downThis deletes the resource group and all resources. The Admin Center entries and Entra identity will be cleaned up automatically over time.
| Topic | Link |
|---|---|
| Official Guide (MS Learn) | Publish a Foundry agent to Agent 365 |
| GitHub Sample | FoundryA365 on GitHub |
| Agent 365 Overview | Agent 365 Documentation |
| Frontier Program | Frontier Enrollment |
| Agent 365 Licensing (GA) | Security Blog: Agent 365 |
Verified end-to-end on April 10, 2026. Agent responded in Teams after a clean azd provision in under 8 minutes β no Docker required.