Skip to content

Azure Key Vault soft-delete conflict can require AppHost model change when tombstone is not discoverable #18403

Description

@davidfowl

Summary

A manually deleted implicit Azure Key Vault can leave an Aspire app in a state where resource commands cannot fully recover without changing the AppHost model.

Observed flow

  1. A PostgreSQL resource uses password authentication, which creates an implicit child Key Vault resource.
  2. The Key Vault is manually deleted outside Aspire while provisioning state is incomplete or failed.
  3. reprovision tries to recreate the same generated vault name.
  4. ARM returns a Key Vault ConflictError saying the vault name already exists in deleted state and must be recovered or purged.
  5. Azure deleted-vault APIs and CLI do not find the deleted vault, so purge/recover cannot be performed.
  6. The Aspire delete-azure-resource path cannot act on the child Key Vault because cached deployment state does not contain a usable resource ID.

Result

The only practical escape was to change the AppHost model so the resource generated a new Key Vault name, then restart the AppHost. That means the no-restart recovery story is incomplete for this edge case.

Expected behavior

Aspire should either provide a no-restart recovery path for this state or surface a clearer diagnostic explaining that the Azure provider reports a deleted-state name conflict but the deleted vault is not discoverable for purge/recover.

Notes

This issue intentionally omits subscription IDs, tenant IDs, local paths, generated vault names, and other environment-specific details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationtriage:bot-seenAspire triage bot has seen this issue

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions