Skip to content

.NET: add container-hosted workflow sample - #8232

Open
Naveen (1aifanatic) wants to merge 1 commit into
microsoft:mainfrom
1aifanatic:contrib/2056-container-workflow
Open

.NET: add container-hosted workflow sample#8232
Naveen (1aifanatic) wants to merge 1 commit into
microsoft:mainfrom
1aifanatic:contrib/2056-container-workflow

Conversation

@1aifanatic

Copy link
Copy Markdown

Motivation & Context

Developers need a runnable example of a pro-code workflow hosted outside Foundry. This sample exposes a small expense-routing workflow over HTTP and builds it into a non-root Linux container. Deterministic executors make deployment verification possible without model credentials.

Description & Review Guide

  • What are the major changes? Add an ASP.NET Core sample with two executors, request validation, per-request workflow instances, and run disposal. Include a multi-stage Dockerfile, a Dockerfile-specific context filter, local/container instructions, and solution/sample-index entries.
  • What is the impact of these changes? No framework APIs or runtime behavior change. A local net10.0 build completed with zero warnings/errors. The Docker image built and ran as UID 1654. Both local and container hosts passed health, review-threshold, invalid-input, and 32-concurrent-request isolation checks. The container build emitted SourceLink warnings because Git metadata is intentionally excluded. Repository-wide unit tests were not run for this sample-only change.
  • What do you want reviewers to focus on? Whether this is the preferred home and scope for the outside-Foundry pro-code deployment example. The README identifies in-process persistence, authentication, and repeated-request boundaries; the sample does not execute payments or claim durable recovery.

Related Issue

Contributes to #2056. This is one of the four requested deployment scenarios; it intentionally does not close the umbrella issue. No competing open PR for this sample was found during the preflight.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings September 10, 2026 12:13
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Sep 10, 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.

🟡 Changes recommended

A stray, nontechnical marker remains in a public sample comment.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a runnable ASP.NET Core sample demonstrating container-hosted, deterministic .NET workflows.

Changes:

  • Adds expense-routing workflow endpoints with validation and isolated runs.
  • Adds a non-root multi-stage container build.
  • Documents usage and registers the sample.
File summaries
File Description
dotnet/samples/04-hosting/README.md Lists the new sample.
dotnet/samples/04-hosting/ContainerWorkflow/README.md Documents usage and hosting boundaries.
dotnet/samples/04-hosting/ContainerWorkflow/Program.cs Implements the HTTP workflow host.
dotnet/samples/04-hosting/ContainerWorkflow/Dockerfile.dockerignore Filters container build context.
dotnet/samples/04-hosting/ContainerWorkflow/Dockerfile Builds the non-root runtime image.
dotnet/samples/04-hosting/ContainerWorkflow/ContainerWorkflow.csproj Defines the sample project.
dotnet/agent-framework-dotnet.slnx Registers the project in the solution.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants