Loading...
Loading...
CLI tool for developing, deploying, and managing Microsoft Agent 365 applications with Azure integration and MCP server support.
npx skill4agent add aradotso/devtools-skills microsoft-agent365-devtools-cliSkill by ara.so — Devtools Skills collection.
dotnet tool install -g Microsoft.Agents.A365.DevTools.Cli --prereleasea365 --versionClient IDTenant ID# Windows PowerShell
$env:AGENT365_CLIENT_ID="your-client-id"
$env:AGENT365_TENANT_ID="your-tenant-id"
# Linux/macOS
export AGENT365_CLIENT_ID="your-client-id"
export AGENT365_TENANT_ID="your-tenant-id"# Set Azure subscription
a365 config set --subscription "your-subscription-id"
# Set resource group
a365 config set --resource-group "agent365-rg"
# Set Azure region
a365 config set --location "eastus"
# View current configuration
a365 config show
# Reset configuration
a365 config reset# Interactive setup (recommended for first-time setup)
a365 setup
# Automated setup with parameters
a365 setup --subscription "sub-id" \
--resource-group "agent365-rg" \
--location "eastus" \
--app-name "my-agent365-app" \
--manifest-path "./agent-manifest.json"
# Setup with existing resources
a365 setup --use-existing-resources --app-service-name "existing-app"# Start MCP server for development
a365 develop start --server-path "./mcp-server" --port 5000
# List running MCP servers
a365 develop list
# Stop MCP server
a365 develop stop --server-id "server-123"
# Test MCP server connection
a365 develop test --server-url "http://localhost:5000"# Register MCP server in Dataverse
a365 develop-mcp register \
--environment "your-env-url" \
--server-name "MyMCPServer" \
--server-url "https://mcp.example.com"
# List MCP servers in environment
a365 develop-mcp list --environment "your-env-url"
# Remove MCP server
a365 develop-mcp remove --environment "your-env-url" --server-id "server-id"# Deploy application binaries
a365 deploy --project-path "./src/MyAgent365App" \
--configuration "Release"
# Deploy with specific runtime
a365 deploy --project-path "./src/MyAgent365App" \
--runtime "win-x64" \
--configuration "Release"
# Deploy and update tool permissions
a365 deploy --project-path "./src/MyAgent365App" \
--update-permissions# Update manifest IDs and package
a365 publish --manifest-path "./agent-manifest.json" \
--output-path "./dist"
# Publish with custom app package name
a365 publish --manifest-path "./agent-manifest.json" \
--output-path "./dist" \
--package-name "my-agent-package"
# Validate manifest only (no packaging)
a365 publish --manifest-path "./agent-manifest.json" \
--validate-only# Query agent scopes and permissions
a365 query-entra --agent-id "agent-blueprint-id"
# Check consent status
a365 query-entra --agent-id "agent-blueprint-id" \
--check-consent
# List all agents in tenant
a365 query-entra --list-all
# Export agent configuration
a365 query-entra --agent-id "agent-blueprint-id" \
--export-config "./agent-config.json"# Clean up all resources (interactive confirmation)
a365 cleanup
# Clean up specific resource group
a365 cleanup --resource-group "agent365-rg"
# Force cleanup without confirmation
a365 cleanup --force
# Clean up only blueprint (keep Azure resources)
a365 cleanup --blueprint-only --agent-id "blueprint-id"~/.agent365/config.json{
"azureSubscriptionId": "your-subscription-id",
"resourceGroup": "agent365-rg",
"location": "eastus",
"appServiceName": "my-agent365-app",
"appServicePlanName": "agent365-plan",
"clientId": "your-client-id",
"tenantId": "your-tenant-id"
}agent-manifest.json{
"$schema": "https://developer.microsoft.com/json-schemas/agent365/v1.0/agent-manifest.schema.json",
"id": "com.example.myagent",
"version": "1.0.0",
"name": {
"short": "My Agent",
"full": "My Agent 365 Application"
},
"description": {
"short": "An intelligent agent",
"full": "A comprehensive agent for Microsoft 365"
},
"developer": {
"name": "Your Company",
"websiteUrl": "https://example.com",
"privacyUrl": "https://example.com/privacy",
"termsOfUseUrl": "https://example.com/terms"
},
"icons": {
"color": "color-icon.png",
"outline": "outline-icon.png"
},
"capabilities": [
{
"name": "conversation",
"messageHandlers": [
{
"type": "message",
"value": "handleMessage"
}
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"*.example.com"
]
}# Install CLI
dotnet tool install -g Microsoft.Agents.A365.DevTools.Cli --prerelease
# Configure environment
a365 config set --subscription $env:AZURE_SUBSCRIPTION_ID
a365 config set --resource-group "agent365-dev-rg"
a365 config set --location "eastus"
# Set up Azure resources and blueprint
a365 setup --manifest-path "./agent-manifest.json"# Start MCP server for testing
a365 develop start --server-path "./mcp-server" --port 5000
# Test your agent locally with the MCP server
# (Use your development framework here)
# Stop MCP server when done
a365 develop stop --server-id "server-123"# Build and deploy application
a365 deploy --project-path "./src/MyAgent365App" \
--configuration "Release" \
--update-permissions
# Verify deployment
az webapp show --name my-agent365-app --resource-group agent365-dev-rg# Package agent for Microsoft 365 Admin Center
a365 publish --manifest-path "./agent-manifest.json" \
--output-path "./dist"
# Upload the generated package to Microsoft 365 Admin Center
# Then hire the agent through Teams# Check agent permissions and consent
a365 query-entra --agent-id $env:AGENT_BLUEPRINT_ID --check-consent
# Export configuration for documentation
a365 query-entra --agent-id $env:AGENT_BLUEPRINT_ID \
--export-config "./docs/agent-config.json"using Microsoft.Agents.Core;
using Microsoft.Agents.Protocols.Adapter;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace MyAgent365App
{
public class Program
{
public static async Task Main(string[] args)
{
var host = Host.CreateDefaultBuilder(args)
.ConfigureServices((context, services) =>
{
// Register Agent 365 services
services.AddAgent365Services(options =>
{
options.ClientId = Environment.GetEnvironmentVariable("AGENT365_CLIENT_ID");
options.TenantId = Environment.GetEnvironmentVariable("AGENT365_TENANT_ID");
options.ManifestPath = "./agent-manifest.json";
});
// Register your agent handler
services.AddSingleton<IAgentHandler, MyAgentHandler>();
})
.Build();
await host.RunAsync();
}
}
public class MyAgentHandler : IAgentHandler
{
public async Task<AgentResponse> HandleMessageAsync(
AgentRequest request,
CancellationToken cancellationToken)
{
// Process agent request
var response = new AgentResponse
{
Text = $"Received: {request.Text}",
SuggestedActions = new[]
{
new AgentAction { Title = "Learn More", Value = "learn_more" }
}
};
return response;
}
}
}# Deploy the C# application
a365 deploy --project-path "./MyAgent365App" \
--configuration "Release" \
--runtime "win-x64"# Required for authentication
AGENT365_CLIENT_ID="your-entra-app-client-id"
AGENT365_TENANT_ID="your-entra-tenant-id"
# Optional for automation
AZURE_SUBSCRIPTION_ID="your-azure-subscription-id"
AGENT365_RESOURCE_GROUP="agent365-rg"
AGENT365_LOCATION="eastus"
AGENT_BLUEPRINT_ID="your-agent-blueprint-id"# Verify Entra ID app registration has delegated permissions
a365 query-entra --agent-id $env:AGENT_BLUEPRINT_ID --check-consent
# Re-login if token expired
az login --tenant $env:AGENT365_TENANT_ID
# Verify environment variables
echo $env:AGENT365_CLIENT_ID
echo $env:AGENT365_TENANT_ID# Verify configuration
a365 config show
# Check Azure resources exist
az group show --name agent365-rg
az webapp show --name my-agent365-app --resource-group agent365-rg
# Re-run setup if resources missing
a365 setup --use-existing-resources# Test MCP server connectivity
a365 develop test --server-url "http://localhost:5000"
# Check server logs
a365 develop list
# Restart MCP server
a365 develop stop --server-id "server-123"
a365 develop start --server-path "./mcp-server" --port 5000# Validate manifest without packaging
a365 publish --manifest-path "./agent-manifest.json" --validate-only
# Check manifest schema
# Ensure all required fields are present and valid
# Verify icon files exist in specified paths# Force cleanup (use with caution)
a365 cleanup --force
# Manual cleanup via Azure CLI
az group delete --name agent365-rg --yes --no-wait
# Remove only blueprint
a365 cleanup --blueprint-only --agent-id $env:AGENT_BLUEPRINT_IDa365 config setagent-manifest.jsonconfig.json--force--no-waitquery-entra