Approving the blueprint requires a Microsoft 365 administrator. If that isn’t you, identify your approver before you start.
Prerequisites
Licensing and enrollment
Creating an autopilot with an agent user account requires the following:- Enroll your tenant in the Frontier preview program.
- Accept the Microsoft Agent 365 terms of service after you enroll. For details, see Preview Microsoft Agent 365 features through the Frontier program.
- Confirm that your tenant has at least one Microsoft 365 Copilot license or one Microsoft Agent 365 license, including Microsoft E7.
- Confirm that a Microsoft Agent 365 Frontier license is available. After enrollment, eligible tenants receive a 25-seat preview subscription. Each Foundry autopilot instance consumes one license, because each instance creates an agent user account.
Permissions
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.
Tools
- Azure CLI
- Azure Developer CLI
- Docker, running
Choose a code sample
Who does this: you. This quickstart uses a code sample. Everything you deploy comes from the sample, so clone one before you start. Both samples do the same thing, so pick the language you prefer: Clone the sample, and then open its folder in a terminal. Run every command in this quickstart from that folder. The sample contains the agent code, the infrastructure templates, and the scripts that create and publish the agent.Provision, build, and publish
Who does this: you or an Azure administrator. This stage needs every permission in the Permissions table except the two that belong to your administrator and to hiring. From the sample folder, sign in with both CLIs, and then provision.azd provision completes with no failed resources, and a request is waiting in the Microsoft 365 admin center.
Depending on your tenant settings, you might need extra Azure CLI sign-in scopes before you provision, such as scopes for Foundry, Microsoft Graph, and Azure Resource Manager. If azd auth login returns an authorization error, use the sign-in commands in the sample README.
You can also run the stages separately, which is useful when different people hold the permissions or when you want to change the agent between stages. Use azd provision --preview to see what the template creates before you commit to it. To control each stage yourself, call the create and publish scripts in the sample’s scripts folder directly instead of letting the post-provision hooks run them.
Provision the infrastructure
Permission needed: Owner, or Contributor plus Role Based Access Control Administrator, at resource group scope. The sample creates a Foundry account and project, a model deployment, an Azure Container Registry, and Application Insights with a Log Analytics workspace. It also creates the role assignments those resources need, which is the part Contributor alone can’t do. Expected result: every resource in the sample template exists and reports success.Build the agent blueprint
Permission needed: Foundry User at project scope, and AcrPush or Container Registry Repository Writer at registry scope. The sample compiles your agent code into a container image, pushes it to the registry, and creates a hosted agent along with its first agent version. Traffic routes to that version. The agent creates two Microsoft Entra objects: an agent identity blueprint and an agent identity for the agent itself. You don’t create these objects, and you don’t need a directory role to get them. Save the deployment values. You need them if you troubleshoot:azd provision again. Each run creates a new agent version.
Publish the agent blueprint
Permission needed: Foundry User at project scope. Publishing submits your agent as an autopilot blueprint and puts it in front of your administrator. The sample does this at the end of provisioning, using the publish script in itsscripts folder.
Publishing sets three things that matter later:
- Autopilot publishing, which is what makes this a blueprint that hires instances rather than an agent published to the agent store.
- The hiring scope, which decides who can create instances after approval.
- The display details, including name, descriptions, and icon.
Each publish uses a version number. If you publish again without incrementing it, the call fails with a
version already exists error. To roll out new agent behavior, create a new agent version instead of republishing.The publish API
The sample calls the Microsoft 365 publish API for you. Read this section if you’re automating the flow, or if you want to know what the sample sends.{{endpoint}} is your project endpoint, in the form https://<resource-name>.services.ai.azure.com/api/projects/<project-name>. Get a token for the https://ai.azure.com audience:
The
agenticUserTemplate object carries the identity settings for the agent user account:
The remaining fields are the display details users see, and they behave the same as for any published agent:
agentDisplayName, appVersion, shortDescription, fullDescription, developerName, developerWebsiteUrl, privacyUrl, and termsOfUseUrl. Set canRespondWithoutMention to control whether the autopilot responds to all messages on its Teams surfaces or only when someone @mentions it.
A complete request body for an autopilot:
publishAsAutopilot to false and omit the agent user template. For that flow, see Publish agents to Microsoft 365 and Teams by using the REST API.
Approve the blueprint
Who does this: your tenant administrator, with Global Administrator or AI Administrator. Reader roles can see the request but can’t approve it. Approving runs a four-part wizard: choose who gets the agent, apply a policy template, grant consent, and publish.- Sign in to the Microsoft 365 admin center, and then select Agents > All agents.
- On the Requests tab, find your autopilot. Its state is Pending activate.

- Select the autopilot to open the Publish new agent wizard.
- On Publish to users, confirm the host products and the publish audience. Under Activate, select who can create agent instances: None, All users, or Specific users or groups. This choice is the hiring scope.

- On Apply template, choose a policy template. Microsoft policies apply by default, and administrators add and edit custom policies. This step also shows how many autopilot licenses the tenant has available.

- On Accept permissions, review the permissions the autopilot requests and select Grant admin consent. Consent here governs the token, meaning what kinds of calls the autopilot is ever allowed to make. It grants no team’s data to anyone.

- On Review and finish, check the audience, the activation scope, and the policy template, and then select Publish.

- Verify the autopilot on the Registry tab. Its status is Available.

Create your instance
Who does this: you, if your administrator included you in the hiring scope. After the autopilot is in the registry, you can hire it from either the Microsoft Teams app store or the Microsoft Copilot agent store.- Find the autopilot under Agents for your team. In Microsoft Teams, go to Apps > Agents for your team.


- Select the autopilot, and then select Create instance.
- Name the instance, set its alias and domain, and confirm who manages it. The name can be up to 32 characters.

- Select Create.

Instance creation is asynchronous. It can take a few minutes before the autopilot is searchable in Teams.
Clean up resources
To remove the Azure resources you created, run:Troubleshooting
Related content
- What is an autopilot in Microsoft Foundry? explains the identity model and why autopilots use blueprints.
- Autopilot lifecycle in Microsoft Foundry covers what happens after you publish, including updating and ending an autopilot.
- Microsoft Agent 365 integration with Foundry covers registry sync, data collection, and data residency.