Nota
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tidħol jew tibdel id-direttorji.
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tibdel id-direttorji.
Important
You need to be part of the Frontier preview program to get early access to Microsoft Agent 365. Frontier connects you directly with Microsoft’s latest AI innovations. Frontier previews are subject to the existing preview terms of your customer agreements. As these features are still in development, their availability and capabilities may change over time.
The agent blueprint defines your agent's identity, permissions, and infrastructure requirements. Create every agent instance from this agent blueprint.
For more information about Agent 365 Identity, see Agent 365 Identity.
Prerequisites
Before you begin, ensure you have the following prerequisites:
Agent 365 CLI - See Agent 365 CLI installation.
Required permissions:
- Valid tenant user with one of the following roles:
- Global Administrator
- Agent ID Administrator
- Agent ID Developer
- Access to an Azure subscription with permissions to create resources
- Valid tenant user with one of the following roles:
Valid
a365.config.jsonfile in your working directory, set up via this step: Setting up Agent 365 config.
Create agent blueprint
Use the a365 setup command to create Azure resources and register your agent blueprint. The blueprint defines your agent's identity, permissions, and infrastructure requirements. This step establishes the foundation for deploying and running your agent in Azure.
Run setup
Run the setup command:
a365 setup -h
The command has various options. You can complete the entire setup in a single command by using a365 setup all or choose more granular options.
The entire setup process performs these operations:
Creates Azure infrastructure (if it doesn't already exist):
- Resource group
- App Service Plan with specified SKU
- Azure Web App with managed identity enabled
Registers agent blueprint:
- Creates the agent blueprint in your Microsoft Entra tenant
- Creates Microsoft Entra application registrations
- Configures the agent identity with required permissions
Configures API permissions:
- Sets up Microsoft Graph API scopes
- Configures Messaging Bot API permissions
- Applies inheritable permissions for agent instances
Updates configuration files:
- Saves generated IDs and endpoints to a new file in your working directory called
a365.generated.config.json - Records managed identity and resource information
- Saves generated IDs and endpoints to a new file in your working directory called
Note
Setup typically takes 3-5 minutes and auto-saves configuration to a365.generated.config.json. If you run as Global Administrator, the CLI might open a browser window for admin consent - complete the consent flow to proceed. If you run as Agent ID Administrator or Developer, no browser window appears; the CLI generates consent URLs for a Global Administrator to complete later.
Setup by using Agent ID Administrator or Agent ID Developer
If you run as Agent ID Administrator or Agent ID Developer (not Global Administrator), a365 setup all completes most steps automatically, but OAuth2 permission grants require a separate Global Administrator step.
What steps complete automatically:
- Azure infrastructure (resource group, App Service Plan, Web App)
- Agent blueprint registration
- Inheritable permissions for agent instances
What steps require a Global Administrator:
- OAuth2 delegated permission grants (
AllPrincipalsconsent) for Microsoft Graph, Agent 365 Tools, Messaging Bot API, Observability API, and Power Platform API
How to complete setup by using a non-admin account:
# Step 1: Run setup as Agent ID Admin or Developer
a365 setup all
# Setup completes all steps it can. The CLI displays next steps
# showing how a Global Administrator can complete the OAuth2 grants.
# Step 2: Share the config folder with a Global Administrator.
# The folder contains a365.config.json and a365.generated.config.json.
# Step 3: The Global Administrator runs:
a365 setup admin --config-dir "<path-to-config-folder>"
Alternatively, the Global Administrator can open the combined consent URL that the CLI saves to a365.generated.config.json (field: combinedAdminConsentUrl) and grant consent in a single browser visit. For more information, see a365 setup admin.
Verify setup
After the setup finishes, you see a summary that shows all the completed steps. Verify the created resources:
Verify generated configuration:
a365 config display -gExpected output includes these critical values:
{ "managedIdentityPrincipalId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "agentBlueprintId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "agentBlueprintObjectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "agentBlueprintServicePrincipalObjectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "agentBlueprintClientSecret": "xxx~xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "agentBlueprintClientSecretProtected": true, "botId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "botMsaAppId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "messagingEndpoint": "https://your-app.azurewebsites.net/api/messages", "resourceConsents": [], "completed": true, "completedAt": "xxxx-xx-xxTxx:xx:xxZ", "cliVersion": "x.x.xx" }Key fields to verify:
Field Purpose What to Check managedIdentityPrincipalIdAzure managed identity authentication Should be a valid GUID agentBlueprintIdYour agent's unique identifier Used in Developer Portal and admin center agentBlueprintObjectIdBlueprint's Microsoft Entra ID messagingEndpointMessage routing Where Teams/Outlook send messages to your agent agentBlueprintClientSecretAuthentication secret Should exist (value is masked) resourceConsentsAPI permissions Should contain resources like Microsoft Graph, Agent 365 Tools, Messaging Bot API, Observability API completedSetup status Should be trueNote
If you ran setup as Agent ID Administrator or Agent ID Developer,
resourceConsentsmight be empty andcompletedmight befalseuntil a Global Administrator runsa365 setup adminto complete the OAuth2 permission grants.Verify Azure resources in Azure Portal:
Or use the
az resource listPowerShell command.# List all resources in your resource group az resource list --resource-group <your-resource-group> --output tableVerify the following resources are created:
Resource Group:
- Go to Resource Groups > Select your resource group
- Verify it contains your App Service Plan and Web App
App Service Plan:
- Go to App Services > App Service Plans
- Find your plan and verify the pricing tier matches your configuration SKU
Web App:
- Go to App Services > Web Apps
- Find your web app, then go to Settings > Identity > System assigned
- Verify status is On
- Note the Object (principal) ID matches
managedIdentityPrincipalId
Verify Microsoft Entra applications in Azure Portal:
Go to Azure Active Directory > App registrations > All applications:
Search for your agent blueprint by the
agentBlueprintIdOpen the application and select API permissions
Verify permissions are granted with green checkmarks:
- Microsoft Graph (delegated and application permissions)
- Messaging Bot API permissions
All permissions show "Granted for [Your Tenant]"
Verify generated configuration file created:
You should have a file named
a365.generated.config.jsonthat contains all the configuration data.Use the Test-Path PowerShell command to check that it exists.
# Check file exists Test-Path a365.generated.config.json # Should return: TrueImportant
Save both
a365.config.jsonanda365.generated.config.jsonfiles. You need these values for deployment and troubleshooting.Verify Web App has managed identity enabled:
Use the
az webapp identity showcommand to check whether managed identity is enabled.az webapp identity show --name <your-web-app> --resource-group <your-resource-group>Expected:
{ "principalId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "type": "SystemAssigned" }Verify Agent blueprint registered in Microsoft Entra:
In Microsoft Entra admin center, search for your
agentBlueprintIdor search by name.Verify that:
✅ App Registration and Enterprise Application appear
✅ On the app registration blueprint, API permissions tab shows all permissions
✅ Status shows "Granted for [Your Tenant]"
For more help, see:
Agent permissions
Before apps and agents can read or write Microsoft 365 data (users, mail, files, Teams, agents, and so on), you must explicitly grant them Microsoft Graph permissions. Microsoft Graph permissions are the authorization model that controls what data and actions an app or service can access through Microsoft Graph APIs across Microsoft 365 and Microsoft Entra ID.
Learn more: Overview of Microsoft Graph permissions
To use Graph permissions for Agent 365 agent instances, the developer must declare them in the agent blueprint. When an administrator activates the blueprint in Microsoft 365 Admin Center, the portal reviews the blueprint's Graph permissions and prompts the administrator to consent to them.
To understand and validate how Graph permissions enable your agent, you can:
- View all Graph permissions that are available.
- Visit Graph Explorer to try queries, inspect responses, and understand permissions.
- Use Microsoft 365 Agents Playground to test your agent locally before deployment.
Apply permissions to your blueprint
Use a365 config permissions to add the required resource permissions to your config, and then run a365 setup permissions custom to apply them to your blueprint in Microsoft Entra.
# Add resource permissions to config
a365 config permissions `
--resource-app-id 00000003-0000-0000-c000-000000000000 `
--scopes Mail.Read,Mail.Send,Chat.Read,Chat.ReadWrite,Chat.Create,User.Read
# Apply permissions to your blueprint
a365 setup permissions custom
For full details on configuring and removing custom permissions, see setup permissions custom.
Next steps
Deploy your agent code to the cloud:
Troubleshooting
This section describes common problems when setting up agent blueprints.
Tip
Agent 365 Troubleshooting Guide contains high-level troubleshooting recommendations, best practices, and links to troubleshooting content for each part of the Agent 365 development lifecycle.
These problems sometimes occur during registration:
- Insufficient permissions error
- Missing Azure CLI authentication
- Resource already exists
- Admin consent not completed
- Configuration files missing or invalid
- Setup completes but resources aren't created
- Agent blueprint not registered in Microsoft Entra
- API permissions not granted
- Managed identity not enabled
- Setup takes too long or stops responding
- Unable to send first message in Teams
Insufficient permissions error
Symptom: Insufficient permissions error during a365 setup command execution.
You need one of the following roles in your Microsoft Entra tenant:
- Global Administrator
- Agent ID Administrator
- Agent ID Developer
And Azure subscription contributor or owner access.
Solution: Verify you have required permissions in Microsoft Entra.
- Go to: Microsoft Entra admin center > Your profile > Assigned roles
- Check Azure subscription access by using the
az account showPowerShell command
Note
If you have Agent ID Administrator or Agent ID Developer role (not Global Administrator), a365 setup all still succeeds but skips OAuth2 permission grants. After setup completes, a Global Administrator must run a365 setup admin to complete the remaining grants. This workflow is expected for organizations where the agent developer and the Global Administrator are different people.
Missing Azure CLI authentication
Symptom: Setup fails with authentication errors.
Solution: Make sure you're connected to Azure and verify your account and subscription.
# Authenticate with Azure
az login
# Verify correct account and subscription
az account show
Resource already exists
Symptom: Setup fails with Resource already exists error for resource group, App Service plan, or Web App.
Solutions: Choose one of the following solutions.
Use existing resources
If resources exist and you want to use them, ensure they match your configuration. Use the
az resource listPowerShell command.az resource list --resource-group <your-resource-group>Delete conflicting resources
Delete the resource group or rename your resources in
a365.config.jsonand rerun setup.Use the
az group deletePowerShell command to delete a resource group.# WARNING: This command deletes all resources in it az group delete --name <your-resource-group>Use cleanup command to start fresh
Use the
cleanupcommand to remove all Agent 365 resources, then use thea365 setup allcommand to rerun setup.Warning
Running
a365 cleanupis destructive.a365 cleanup a365 setup all
Admin consent not completed
Symptom: You opened browser windows during setup but closed them without completing consent, or setup completed but OAuth2 permission grants are still pending.
Solution: Choose based on your role:
Global Administrator: Run
a365 setup allagain. The CLI prompts for admin consent. Complete the consent flow in the browser window that appears.Agent ID Administrator or Developer: You can't complete OAuth2 grants directly. Use the handoff workflow:
# Option 1: Global Admin runs setup admin a365 setup admin --config-dir "<path-to-config-folder>" # Option 2: Global Admin opens the combined consent URL # Find the URL in a365.generated.config.json (combinedAdminConsentUrl field) a365 config display -g
Configuration files missing or invalid
Symptom: Setup fails with "Configuration not found" or validation errors.
Solution:
- Verify the
a365.config.jsonfile exists. - Display current configuration using the a365 config display command.
- If missing or invalid, reinitialize using the a365 config init command.
# Verify a365.config.json exists
Test-Path a365.config.json
# Display current configuration
a365 config display
# If missing or invalid, re-initialize
a365 config init
Setup completes but resources aren't created
Symptom: Setup command succeeds but Azure resources don't exist.
Solution:
- Check created resources using the
a365 config display -gcommand. - Verify Azure resources exist using the
az resource listcommand. - If resources are missing, check for errors in setup output and rerun setup using the
a365 setup allcommand.
# Check created resources
a365 config display -g
# Verify Azure resources exist
az resource list --resource-group <your-resource-group> --output table
# If resources missing, check for errors in setup output and re-run
a365 setup all
Agent blueprint not registered in Microsoft Entra
Symptom: Setup completes but you can't find agent blueprint in Microsoft Entra admin center.
Solution:
Get blueprint ID from generated config using the a365 config display -g command.
a365 config display -g # Look for: agentBlueprintIdSearch in Microsoft Entra admin center:
- Go to: Microsoft Entra admin center.
- Navigate to App registrations > All applications.
- Search for your
agentBlueprintId.
If not found, rerun setup using the
a365 setup allcommand.a365 setup all
API permissions not granted
Symptom: Setup completes but permissions show as "Not granted" in Microsoft Entra.
Solution:
Find your agent blueprint app registration.
Go to API permissions.
Grant admin consent:
- Select Grant admin consent for [Your Tenant].
- Confirm the action.
Verify all permissions show green checkmarks.
Managed identity not enabled
Symptom: Web App exists, but managed identity isn't enabled.
Solution:
- Check managed identity status by using the
az webapp identity showcommand. - If not enabled, enable it manually by using the
az webapp identity assigncommand. - Verify it's enabled by using the
az webapp identity showcommand.
# Check managed identity status
az webapp identity show --name <your-web-app> --resource-group <your-resource-group>
# If not enabled, enable it manually
az webapp identity assign --name <your-web-app> --resource-group <your-resource-group>
# Verify it's enabled
az webapp identity show --name <your-web-app> --resource-group <your-resource-group>
Setup takes too long or stops responding
Symptom: Setup command runs for more than 10 minutes without completing.
Solution:
If running as Global Administrator, check if a browser window is waiting for admin consent. Complete the consent flow to unblock setup.
If setup truly stops responding, cancel it (Ctrl+C) and check what was created.
# Check generated config a365 config display -g # Check Azure resources az resource list --resource-group <your-resource-group>Clean up and retry.
a365 cleanup a365 setup all
Unable to send first message in Teams
Symptom: Once an agent instance is provisioned, it can't send a message to the agent manager as a welcome message.
Solution: The [Chat.Create][perm-chatcreate] permission is required to create a new chat object. If a one-on-one chat already exists, this operation returns the existing chat and doesn't create a new one.
- To implement, configure your blueprint's inheritable permissions to include the
Chat.Createscope. - Configure a Teams chat message to send once an agent instance is provisioned.
- Create a new agent instance from the blueprint and test the first-run message.