microsoft / microsoft/aspire

DefaultAzureCredential silently goes stale during Aspire provisioning — no error, no timeout, process hangs forever

Open
#16,749 0 comments 0 reactions 0 assignees View on GitHub
needs-area-label
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

## Description

When using `DefaultAzureCredential` (particularly Visual Studio-provided credentials) during Aspire provisioning of Foundry resources, credentials can silently expire. When this happens:

- **No error is thrown**
- **No timeout occurs**
- **No authentication prompt appears**
- **The process hangs forever**

The developer has no way to know whether auth failed, whether provisioning is still progressing, or whether they should retry or re-authenticate.

## Impact

- Blocks **every first-run experience** for new developers using Aspire + Foundry
- Described as the **"#1 frustration point for new developers"** in a cross-team investigation
- Turns straightforward provisioning into a multi-hour debugging session with no actionable feedback

## Steps to Reproduce

1. Create an Aspire app that provisions Foundry resources (e.g., using `AddFoundry()`)
2. Authenticate via Visual Studio Azure identity
3. Wait for credentials to go stale (exact timing unclear — no timeout is documented)
4. Run `azd provision` or equivalent Aspire provisioning
5. Observe: process hangs indefinitely with no output

## Expected Behavior

`DefaultAzureCredential` should either refresh transparently, throw a clear error with guidance, or time out with a diagnostic message suggesting re-authentication.

## Actual Behavior

Silent infinite hang. No error, no timeout, no prompt.

## Workarounds

None known.

## Environment

- .NET SDK: 10.0.300-preview
- Aspire: 13.3.0-preview.1.26201.14
- Azure.Identity: 1.20.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.