Radius publisher hangs on `aspire publish` when a container references a cloud-managed Azure resource
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Description
The `Aspire.Hosting.Radius` publisher only maps **portable, recipe-backed** resources to Radius resource types — `AddRedis`, `AddSqlServer`, `AddPostgres`, `AddMongoDB`, `AddRabbitMQ`, and Dapr building blocks (see `ResourceTypeMapper`). It does **not** translate cloud-managed Azure resources such as **Key Vault, Storage, Service Bus, or Azure Managed Redis** into Radius resources.
When a Radius-targeted container `WithReference`s one of these unmapped Azure resources, `aspire publish` **hangs indefinitely** instead of failing fast. No `app.bicep` is produced and no actionable error is shown.
### Root cause
During container env emission, `RadiusInfrastructureBuilder.ResolveEnvironmentAsync` (`src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs:248` → value resolution at ~`:1074`) awaits `IValueProvider.GetValueAsync` for the referenced resource's connection info. For an Azure resource, that resolves an `Azure.BicepOutputReference`, whose `GetValueAsync` blocks waiting on provisioning output that never arrives in publish mode — so publish never completes.
### Expected behavior
`aspire publish` should **fail fast** with an actionable error explaining that the Radius publisher does not currently support cloud-managed Azure resources (and listing what *is* supported), rather than hanging.
### Steps to reproduce
1. AppHost targeting Radius (`AddRadiusEnvironment`).
2. `AddContainer(...)` with `.WithReference()`.
3. `aspire publish --output-path ./out`.
4. **Actual:** publish hangs; no `app.bicep`. **Expected:** fast, clear failure.
### Notes / evidence
- Documented as a gap test: `tests/Aspire.Deployment.EndToEnd.Tests/RadiusAzureResourcesDeploymentTests.cs` (currently asserts the timeout to capture the gap; **not** yet `[ActiveIssue]`-gated).
- The `Aspire.Hosting.Radius` README "known limitations" already notes cloud-managed resources are out of scope for this preview release.
- Once fixed, gate/rewrite the gap test with `[ActiveIssue()]` so it asserts the corrected fail-fast (or success) behavior.
- Related: fix for the Radius service-discovery mismatch is in #18797.
Contributor guide
Research direction
Start in src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs, especially ResolveEnvironmentAsync and the value-resolution path around the cited lines. Reproduce the hang with the Azure-resource reference scenario, then inspect tests/Aspire.Deployment.EndToEnd.Tests/RadiusAzureResourcesDeploymentTests.cs. Done means publish fails promptly with an actionable unsupported-resource error and the gap test is updated and gated as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100