-
Notifications
You must be signed in to change notification settings - Fork 753
Description
Is there an existing issue for this?
- I have searched the existing issues
Build information
Build:
- Build URL: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1161145&view=ms.vss-test-web.build-test-results-tab&runId=32113528&resultId=101295&paneView=debug
- Console Log: https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-aspire-refs-heads-copilot-fix-24cb4838bb2e5d7eb0a64615bc/Aspire.Hosting.Azure.Tests/1/console.b87ecd36.log
- CI System: Azure DevOps (Helix)
- OS: Windows 11 (10.0.26100-SP0)
- Target Framework: net8.0 | x64
- Aspire Version: 9.6.0-ci
- Build: 20250929.20
Build error leg or test failing:
Aspire.Hosting.Azure.Tests.AzureDeployerTests
Pull Request: N/A
Fill in the error message template
Error Message
Multiple tests in Aspire.Hosting.Azure.Tests.AzureDeployerTests are failing exclusively on Azure DevOps (passing on GitHub Actions workflows) with KeyNotFoundException when trying to access Azure resource configuration keys.
Primary Failures (KeyNotFoundException)
All 7 tests fail with the same root cause - missing Azure resource configuration keys:
DeployAsync_WithMultipleComputeEnvironments_Works(line 370) - Missing:AZURE_CONTAINER_REGISTRY_NAMEDeployAsync_WithContainer_Works(line 188) - Missing:AZURE_CONTAINER_REGISTRY_NAMEDeployAsync_WithProjectResource_Works(line 291) - Missing:AZURE_CONTAINER_REGISTRY_NAMEDeployAsync_WithDockerfile_Works(line 235) - Missing:AZURE_CONTAINER_REGISTRY_NAMEDeployAsync_WithOnlyAzureResources_PrintsDashboardUrl(line 639) - Missing:AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAINDeployAsync_WithSingleRedisCache_CallsDeployingComputeResources(line 589) - Missing:AZURE_CONTAINER_REGISTRY_NAMEDeployAsync_WithAzureFunctionsProject_Works(line 891) - Missing:AZURE_CONTAINER_REGISTRY_NAME
Secondary Failures (Missing Project Files)
2 additional tests failed due to missing test project files:
PublishAsAzureAppServiceWebsite_ThrowsIfNoEnvironmentMultipleAzureAppServiceEnvironmentsSupported
Stack Trace
System.Collections.Generic.KeyNotFoundException : The given key 'AZURE_CONTAINER_REGISTRY_NAME' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Aspire.Hosting.Azure.Tests.AzureDeployerTests.DeployAsync_WithMultipleComputeEnvironments_Works() in D:\a\_work\1\s\tests\Aspire.Hosting.Azure.Tests\AzureDeployerTests.cs:line 370
--- End of stack trace from previous location ---
Similar stack traces occur for other failing tests at different line numbers (188, 235, 291, 589, 639, 891).
Notable Environment Differences (AzDO vs GitHub Actions)
- Docker Unavailability:
Could not harvest all abandoned containers {"Error": "exec: \"docker\": executable file not found in %PATH%"} - User Secrets Path Issues (warnings):
warn: Aspire.Hosting.Azure.Provisioning.Internal.DefaultUserSecretsManager[0]
Failed to save user secrets.
System.InvalidOperationException: User secrets path could not be determined.
Other info
Test Context and Environment
The tests are using mock Azure provisioning with test credentials:
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Default subscription: Test Subscription (/subscriptions/12345678-1234-1234-1234-123456789012)
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Tenant: 87654321-4321-4321-4321-210987654321
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Using existing resource group test-rg.
Analysis
Root Cause: The tests expect Azure resource configuration keys (primarily AZURE_CONTAINER_REGISTRY_NAME and AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN) to be present in a dictionary during the deployment provisioning phase, but these keys are not being populated in the AzDO/Helix environment.
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 0 | 0 |
Last 10 failures:
| Run date | Build Type | Test Name | OS |
|---|
Summary
| Last 24 hrs | Last 7 days | Last 30 days | Most Affected OS | Failure Rate |
|---|---|---|---|---|
| 0 | 0 | 0 | N/A | 0.0% |
-- Updated on 10/27/2025 5:54:46 AM UTC