Skip to content

.NET: [CI] AzureFunctions SamplesValidation tests fail — func tools cannot detect worker runtime #6402

@giles17

Description

@giles17

Summary

All 7 active SamplesValidation tests in Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests fail consistently in the dotnet-test-functions CI job. The Azure Functions Core Tools (v4) can no longer auto-detect the worker runtime when launching the samples.

Failure signature

[dotnet(err)]: Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --python, --powershell, --custom, --go (preview)]
[dotnet(err)]: Worker runtime cannot be 'None'. Please set a valid runtime.

The Functions host process exits with code 1 before starting, causing WaitForFunctionsReadyAsync (AzureFunctionsTestHelper.cs:86) to throw InvalidOperationException.

Root cause analysis

  1. The CI setup action (azure-functions-integration-setup) installs azure-functions-core-tools@4 via npm (floating version — picks up latest v4 patch).
  2. The samples' local.settings.json files are .gitignore'd (they contain secrets), so they are never present in CI.
  3. The test helper (SamplesValidation.StartFunctionApp) launches dotnet run with environment variables for OpenAI, storage, etc., but does NOT set FUNCTIONS_WORKER_RUNTIME.
  4. Previously the Functions host could infer dotnet-isolated from the project structure; a recent v4 update appears to require explicit configuration.

Affected tests (all in SamplesValidation.cs)

  • SingleAgentSampleValidationAsync
  • MultiAgentOrchestrationConcurrentSampleValidationAsync
  • MultiAgentOrchestrationConditionalsSampleValidationAsync
  • SingleAgentOrchestrationHITLSampleValidationAsync
  • LongRunningToolsSampleValidationAsync
  • AgentAsMcpToolAsync
  • ReliableStreamingSampleValidationAsync

Example failing run

https://github.com/microsoft/agent-framework/actions/runs/27157145899/job/80162891404

Proposed fix

Add FUNCTIONS_WORKER_RUNTIME=dotnet-isolated to the environment variables set by StartFunctionApp in SamplesValidation.cs:

startInfo.EnvironmentVariables["FUNCTIONS_WORKER_RUNTIME"] = "dotnet-isolated";

Additionally consider pinning the Azure Functions Core Tools version in azure-functions-integration-setup/action.yml to prevent future breakage from floating versions.

Mitigation

Tests are temporarily skipped pending this fix.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions