Skip to content

.NET: document Azure Functions trigger discovery - #5946

Closed
Yufeng He (he-yufeng) wants to merge 3 commits into
microsoft:mainfrom
he-yufeng:docs/azurefunctions-trigger-discovery
Closed

.NET: document Azure Functions trigger discovery#5946
Yufeng He (he-yufeng) wants to merge 3 commits into
microsoft:mainfrom
he-yufeng:docs/azurefunctions-trigger-discovery

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • add a small local orchestration trigger to the 06_host_your_agent Azure Functions sample so the isolated worker indexes Durable Functions
  • document why hosting-only apps may need one local [OrchestrationTrigger] for discovery
  • add a troubleshooting note for missing hosted agent routes in the Azure Functions samples README

Refs #5927.

To verify

  • dotnet build dotnet\samples\01-get-started\06_host_your_agent\06_host_your_agent.csproj --tl:off
  • dotnet format dotnet\samples\01-get-started\06_host_your_agent\06_host_your_agent.csproj --include dotnet\samples\01-get-started\06_host_your_agent\DurableTriggerDiscovery.cs --verify-no-changes --no-restore --verbosity minimal
  • git diff --check

Copilot AI review requested due to automatic review settings May 19, 2026 05:07
@moonbox3 Evan Mattson (moonbox3) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents and mitigates an Azure Functions (.NET isolated) Durable Functions trigger discovery limitation that can prevent hosted agent HTTP routes from being indexed unless at least one durable trigger exists in the app assembly.

Changes:

  • Added a note to the AzureFunctions hosting package README explaining the need for a local [OrchestrationTrigger] for trigger discovery in hosting-only apps.
  • Added a minimal no-op orchestrator (DurableTriggerDiscovery) to the 06_host_your_agent Azure Functions sample to ensure Durable Functions indexing occurs.
  • Added troubleshooting guidance to the Durable Agents Azure Functions samples README for missing hosted agent routes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/README.md Documents the trigger discovery requirement and provides a minimal orchestrator example.
dotnet/samples/04-hosting/DurableAgents/AzureFunctions/README.md Adds a troubleshooting note for when hosted agent routes don’t appear.
dotnet/samples/01-get-started/06_host_your_agent/DurableTriggerDiscovery.cs Introduces a local no-op orchestrator to force Durable trigger discovery/indexing.

Comment on lines 62 to +65
By default, each agent can be invoked via a built-in HTTP trigger function at the route `http[s]://[host]/api/agents/{agentName}/run`.

> [!NOTE]
> In .NET isolated Azure Functions apps, the worker SDK discovers Durable Functions triggers from the app assembly. If your app only hosts agents through `ConfigureDurableAgents(...)` and does not define any Durable orchestrator functions, add a small `[OrchestrationTrigger]` function in your app assembly so the Durable extension is indexed.
@he-yufeng
Yufeng He (he-yufeng) force-pushed the docs/azurefunctions-trigger-discovery branch from a6344b3 to 53b6127 Compare May 20, 2026 05:26
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Refreshed on current main. Local validation passed: dotnet build dotnet\samples\01-get-started\06_host_your_agent\06_host_your_agent.csproj --tl:off, dotnet format ... --verify-no-changes, and git diff --check.

@he-yufeng
Yufeng He (he-yufeng) force-pushed the docs/azurefunctions-trigger-discovery branch from 53b6127 to bb219ae Compare June 12, 2026 03:35
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this branch onto current main and pushed the updated head bb219ae8.

Validation run locally from dotnet/:

  • dotnet build .\samples\01-get-started\06_host_your_agent\06_host_your_agent.csproj -f net10.0 --tl:off -> passed, 0 warnings/errors
  • git diff --check upstream/main..HEAD -> passed

The build log had transient NuGet EOF download messages, but restore retried/resolved and the project built successfully.

@he-yufeng
Yufeng He (he-yufeng) force-pushed the docs/azurefunctions-trigger-discovery branch from bb219ae to 6623a53 Compare June 12, 2026 11:54
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this branch onto the latest upstream/main.

Validation from dotnet/:

  • dotnet build .\samples\01-get-started\06_host_your_agent\06_host_your_agent.csproj -f net10.0 --tl:off
  • git diff --check upstream/main..HEAD

The sample build completes with 0 warnings / 0 errors on the rebased head (6623a534).

@he-yufeng
Yufeng He (he-yufeng) force-pushed the docs/azurefunctions-trigger-discovery branch 10 times, most recently from 5d3046e to 870284b Compare June 18, 2026 08:59
@he-yufeng
Yufeng He (he-yufeng) force-pushed the docs/azurefunctions-trigger-discovery branch from 870284b to d1d90bb Compare June 24, 2026 01:09
@he-yufeng
Yufeng He (he-yufeng) force-pushed the docs/azurefunctions-trigger-discovery branch from d1d90bb to 4f04c48 Compare June 25, 2026 01:27
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Gentle nudge on this one. The gap it documents is real and easy to hit: an Azure Functions app that only hosts agents never gets its Durable orchestrations indexed, because the isolated worker only discovers them through a local [OrchestrationTrigger]. The sample now shows the minimal trigger to add, and the README's troubleshooting note names the symptom (missing hosted agent routes) so people can find it from the error side. Small, self-contained, CLA and label checks are green.

@he-yufeng

Copy link
Copy Markdown
Contributor Author

Closing this as superseded by the repo split: #7465 (ADR-0032) moved the Azure Functions hosting integration to microsoft/agent-framework-durable-extension, including the README this PR documented. The trigger-discovery gap travels with the package, so I will re-port the doc there instead of keeping this open against a deleted file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants