Skip to content

RunAsFoundryLocal fails on Foundry CLI 0.10+: still calls foundry service (renamed to foundry server) #20189

Description

Description

AddFoundry(...).RunAsFoundryLocal() fails immediately on Foundry Local CLI 0.10.x because the hosting integration still invokes foundry service, which was removed in the CLI 0.10 rewrite.

The Foundry resource goes to FailedToStart. Any deployment (AddDeployment) never starts. Resources that WaitFor that deployment stay Waiting (kernel/app deadlock).

Repro

  1. Install Foundry Local CLI 0.10.3 (foundry --version → 0.10.3). Confirm:
foundry --help

Command groups include server, not service.

  1. AppHost:
var foundry = builder.AddFoundry("foundry").RunAsFoundryLocal();
var whisper = foundry.AddDeployment("whisper-large-v3-turbo", "whisper-large-v3-turbo", "1", "OpenAI");
builder.AddProject<Projects.MyApp>("app").WaitFor(whisper);
  1. aspire start (or F5).

Actual

Foundry resource console:

error: Unknown command: 'service'
Hint: Did you mean 'server'? Run 'foundry --help' to see available commands.
Foundry Local could not be started. Ensure it's installed correctly: https://learn.microsoft.com/azure/ai-foundry/foundry-local/get-started (Error: Foundry CLI service exited before reporting an endpoint. Exit code: 2.).

Expected

RunAsFoundryLocal should start the daemon with the current CLI:

Old CLI (≤0.8) CLI 0.10+
foundry service start/stop/restart foundry server start/stop/restart

Documented in:

Aspire docs still say foundry service start:
https://aspire.dev/integrations/cloud/azure/azure-ai-foundry/azure-ai-foundry-host/

Environment

  • Aspire CLI: 13.5.3
  • Aspire.Hosting.Foundry: 13.5.3-preview.1.26425.3
  • Foundry Local CLI: 0.10.3 (foundry server, foundry transcribe, no foundry service)
  • OS: Windows 11 x64
  • AppHost: .NET 11 / Aspire 13.5.3

Related

Suggested fix

Detect CLI version / help output and call foundry server start on 0.10+, keep foundry service start as fallback for older CLIs. Update hosting docs to match CLI 0.10.

Activity

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

Metadata

Metadata

Labels

area-integrationsIssues pertaining to Aspire Integrations packagestriage:bot-seenAspire triage bot has seen this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions