Skip to content

Foundry Agents Hosting Integration#14149

Open
ericsuh wants to merge 36 commits intodotnet:mainfrom
ericsuh:ericsuh/hosting-az-cogser
Open

Foundry Agents Hosting Integration#14149
ericsuh wants to merge 36 commits intodotnet:mainfrom
ericsuh:ericsuh/hosting-az-cogser

Conversation

@ericsuh
Copy link

@ericsuh ericsuh commented Jan 27, 2026

Description

This is a hosting integration for developing, running, and deploying Foundry Hosted Agents. It treats agents as compute resources and Foundry Projects as compute environments, and uses pipelines to deploy them in much the same way as ACA or Azure App Service deploys containers.

The eventual goal is to have two scenarios as aspire templates or examples:

  • Basic:
    • Web App Server -> Hosted Agent
    • Hosted Agent -> Prompt Agent
    • Agents -> Foundry Project, Deployments, etc.
  • Enterprise:
    • Above with Vnet, BYO storage/cosmos, user-assigned identities, Bing grounding
    • A chatkit server in between agent and web app
    • Web app is a chatkit frontend

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14149

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14149"

@ericsuh ericsuh changed the title Foundry Agents Hosting Integration [WIP] Foundry Agents Hosting Integration Jan 27, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 27, 2026
Needed to comment out some pipeline calls that need to be reworked.
Eric Suh and others added 4 commits February 9, 2026 22:00
Resolve merge conflicts in CosmosDB (Id property rename, ToBicepExpression),
KeyVault (id output with ToBicepExpression), and update AIFoundry
ConnectionBuilderExtensions to use renamed Id property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sting integration

Code quality fixes:
- Remove PLAN.md from source package
- Fix double semicolon in HostedAgentBuilderExtension
- Replace Console.WriteLine with comments in PublishAsync methods
- Rename capabilityHostConfiguration to PascalCase convention
- Revert unrelated .vscode/settings.json change

Test fixes:
- Fix broken test assertions (wrong name, type, env var key/value)
- Fix cross-platform test failures (line ending normalization)
- Remove duplicate test and commented-out code

New test coverage (40 new tests, 45 total):
- ProjectResourceTests: resource creation, relationships, expressions
- ProjectWithReferenceTests: env var injection patterns
- HostedAgentConfigurationTests: CPU/memory, validation, formatting
- HostedAgentExtensionTests: run/publish mode, region validation
- StaticValueProviderTests: get/set, error handling
- PromptAgentConfigurationTests: constructor, options generation

Documentation:
- Improve XML docs for WithKeyVault, WithAppInsights, WithCapabilityHost
- Update README with Project, Hosted Agent, and connection properties

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused Aspire.Hosting.Python project reference (Thread 1)
- Remove unnecessary Aspire.Hosting.Azure.OperationalInsights reference,
  already transitive via ApplicationInsights (Thread 2)
- Refactor ContainerRegistry to match ACA pattern (Thread 4):
  - Remove IContainerRegistry from class declaration
  - Add IAzureComputeEnvironmentResource.ContainerRegistry explicit impl
  - Add GetContainerRegistry() helper matching ACA pattern
  - ContainerRegistry property now returns AzureContainerRegistryResource?
    with validation, matching ACA's approach

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros marked this pull request as ready for review February 13, 2026 19:46
Copilot AI review requested due to automatic review settings February 13, 2026 19:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This WIP PR introduces a hosting integration for developing, running, and deploying Azure AI Foundry Hosted Agents. It treats agents as compute resources and Foundry projects as compute environments, enabling deployment workflows similar to Azure Container Apps or Azure App Service.

Changes:

  • New Aspire.Hosting.Azure.AIFoundry package with support for AI Foundry projects, hosted agents, and prompt agents
  • Project templates for creating AI Foundry agent applications (aspire-agent-starter)
  • Integration with Azure Container Registry for agent container management
  • Support for capability hosts with BYO (Bring Your Own) storage, Cosmos DB, and search resources
  • Test suite covering project resources, hosted agents, connections, and configurations
  • Playground examples demonstrating basic and enterprise agent scenarios

Reviewed changes

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

Show a summary per file
File Description
src/Aspire.Hosting.Azure.AIFoundry/*.cs Core resource definitions for projects, agents, connections, and extensions
src/Aspire.ProjectTemplates/templates/aspire-agent-starter/ Project template for creating hosted agent applications
tests/Aspire.Hosting.Azure.AIFoundry.Tests/*.cs Unit tests for project, agent, and connection resources
playground/FoundryAgentBasic/ Basic agent example with Python backend
playground/FoundryAgentEnterprise/ Enterprise example with additional infrastructure
src/Aspire.Hosting.Azure*/AzureApplicationInsightsResource.cs Added IdOutputReference for AI Foundry connections
src/Aspire.Hosting.Azure*/AzureKeyVaultResource.cs Added IdOutputReference for AI Foundry connections
src/Aspire.Hosting.Azure*/AzureStorageResource.cs Added IdOutputReference for AI Foundry connections

sebastienros and others added 3 commits February 13, 2026 12:09
The PR added 'output id' to ApplicationInsights Bicep but didn't update
the verified snapshot files. Also fixed missing .ToBicepExpression() on
appInsights.Id (matching the pattern used by CosmosDB and KeyVault).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Azure.Provisioning.CognitiveServices package was bumped from 1.1.0
to 1.2.0, which generates API version 2025-09-01 instead of 2024-10-01.
Update all verified snapshot files and hardcoded test assertions to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros
Copy link
Member

@ericsuh looks like you need to accept the CLA with a comment like @dotnet-policy-service agree company="Microsoft"

@sethjuarez
Copy link
Member

Is it weird that the namespace is Aspire.Hosting.Azure.AIFoundry but it's actually called "Microsoft Foundry"? Tiny nit

@sebastienros
Copy link
Member

sebastienros commented Feb 20, 2026

@sethjuarez who knows what it will be called in 6 months? Here is a proof it was called Azure AI Foundry when we defined the namespace. https://www.youtube.com/watch?v=GD7MnIwAxYM&t=9s

We might decide to change the naming in a different PR and deprecate this component, this is not a simple decision to take. At some point it may have been under Cognitive Search name ... Should we switch to Copilot Foundry already (just kidding)?

@ericsuh
Copy link
Author

ericsuh commented Feb 20, 2026

@dotnet-policy-service agree company="Microsoft"

@maddymontaquila
Copy link
Member

I agree with @sethjuarez - we should prob just kill Azure.AI.Foundry integration (deprecate) and then do a new Aspire.Hosting.Microsoft.Foundry? or even Aspire.Hosting.Foundry (a la Aspire.Hosting.Orleans)

@tommasodotNET
Copy link

tommasodotNET commented Feb 25, 2026

I agree with @sethjuarez - we should prob just kill Azure.AI.Foundry integration (deprecate) and then do a new Aspire.Hosting.Microsoft.Foundry? or even Aspire.Hosting.Foundry (a la Aspire.Hosting.Orleans)

Aspire.Hosting.AI.Foundry could work? it keeps the foundry name, does not refer to microsoft or azure, and categorizes it under the AI namespace.

@sebastienros sebastienros changed the title [WIP] Foundry Agents Hosting Integration Foundry Agents Hosting Integration Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants