Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,13 @@ devTools/
node_modules/
*.tsbuildinfo


# a365 CLI local/generated config (tenant/app identifiers - do not commit)
a365.config.json
a365.generated.config.json

# a365-generated Teams app package
**/appPackage/

# Slack extension per-conversation state (may contain API tokens)
samples/dotnet/Agent Framework/slack/
374 changes: 327 additions & 47 deletions samples/dotnet/Agent Framework/Agent/WeatherAgent.cs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions samples/dotnet/Agent Framework/AgentFrameworkWeather.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
<PackageReference Include="Microsoft.Agents.Authentication.Msal" Version="1.6.*" />
<PackageReference Include="Microsoft.Agents.Hosting.AspNetCore" Version="1.6.*" />

<!-- Slack channel extension (Slack Blocks / interactive messages) -->
<PackageReference Include="Microsoft.Agents.Extensions.Slack" Version="1.6.*" />

<!-- Agent 365 (WorkIQ) MCP Tooling -->
<PackageReference Include="Microsoft.Agents.A365.Tooling" Version="1.0.*" />
<PackageReference Include="Microsoft.Agents.A365.Tooling.Extensions.AgentFramework" Version="1.0.*" />

<!-- Agent Framework Packages -->
<PackageReference Include="AdaptiveCards" Version="3.1.0" />
<PackageReference Include="Azure.AI.OpenAI" Version="2.7.0-beta.2" />
Expand Down
27 changes: 18 additions & 9 deletions samples/dotnet/Agent Framework/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using AgentFrameworkWeather.Agent;
using Azure;
using Azure.AI.OpenAI;
using Microsoft.Agents.A365.Tooling.Extensions.AgentFramework.Services;
using Microsoft.Agents.A365.Tooling.Services;
using Microsoft.Agents.Builder;
using Microsoft.Agents.Core;
using Microsoft.Agents.Hosting.AspNetCore;
Expand All @@ -20,8 +22,8 @@
builder.Services.AddHttpClient("WebClient", client => client.Timeout = TimeSpan.FromSeconds(600));
builder.Services.AddHttpContextAccessor();

// Configure defaults for Aspire dashboard
builder.ConfigureOtelProviders();
// Configure defaults for Aspire dashboard
builder.ConfigureOtelProviders();

builder.Logging.AddConsole();

Expand All @@ -34,6 +36,13 @@
// in a cluster of Agent instances.
builder.Services.AddSingleton<IStorage, MemoryStorage>();

// ********** Configure A365 (WorkIQ) Services **********
// Registers the MCP tool registration + server configuration services so the
// agent can discover and call WorkIQ (Agent 365) MCP tools at runtime.
builder.Services.AddSingleton<IMcpToolRegistrationService, McpToolRegistrationService>();
builder.Services.AddSingleton<IMcpToolServerConfigurationService, McpToolServerConfigurationService>();
// ********** END Configure A365 Services **********

// Add the bot (which is transient)
builder.AddAgent<WeatherAgent>();

Expand Down Expand Up @@ -72,17 +81,17 @@
app.UseAuthentication();
app.UseAuthorization();

// Map GET "/"
app.MapAgentRootEndpoint();
// Map the endpoints for all agents using the [AgentInterface] attribute.
// If there is a single IAgent/AgentApplication, the endpoints will be mapped to (e.g. "/api/message").
app.MapAgentApplicationEndpoints(requireAuth: !(app.Environment.IsDevelopment() || app.Environment.EnvironmentName == "Playground"));
// Map GET "/"
app.MapAgentRootEndpoint();

// Map the endpoints for all agents using the [AgentInterface] attribute.
// If there is a single IAgent/AgentApplication, the endpoints will be mapped to (e.g. "/api/message").
app.MapAgentApplicationEndpoints(requireAuth: !(app.Environment.IsDevelopment() || app.Environment.EnvironmentName == "Playground"));

if (app.Environment.IsDevelopment() || app.Environment.EnvironmentName == "Playground")
{
app.UseDeveloperExceptionPage();
app.MapControllers().AllowAnonymous();
app.MapControllers().AllowAnonymous();
}
else
{
Expand Down
12 changes: 12 additions & 0 deletions samples/dotnet/Agent Framework/ToolingManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"mcpServers": [
{
"mcpServerName": "mcp_TeamsServer",
"mcpServerUniqueName": "mcp_TeamsServer",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_TeamsServer",
"scope": "Tools.ListInvoke.All",
"audience": "ce5029ee-c1d3-45c0-bdcc-efb5a4245687",
"publisher": "Microsoft"
}
]
}
7 changes: 7 additions & 0 deletions samples/dotnet/Agent Framework/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
"NormalizeMentions": false
},

"AgentApplication": {
// WorkIQ MCP auth handler names. Leave empty for local dev (uses BEARER_TOKEN env var).
// Set these for production / Teams to use OBO / agentic token exchange.
"AgenticAuthHandlerName": "",
"OboAuthHandlerName": ""
},

"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down
Loading