Skip to content

Implement deployment state caching for aspire deploy #11444

@captainsafia

Description

@captainsafia

Currently, the aspire deploy command requires users to re-enter deployment configuration on each deployment and regenerates secrets/passwords, leading to:

  1. Configuration fatigue: Repeated prompts for subscription, resource group, and location
  2. Inconsistent secrets: Generated passwords change between deployments, breaking data persistence
  3. Developer friction: Extra steps that slow down iterative development workflows

Scenario 1: Deployment Configuration Re-prompting

When using aspire deploy, users are repeatedly prompted for:

  • Azure Subscription ID
  • Resource Group name
  • Azure Location/Region

This information should be cached after the first deployment to the same environment.

Scenario 2: Generated Value Regeneration

Resources that generate passwords/secrets (like Redis with WithAccessKeyAuthentication()) create new values on each deployment:

var redis = builder.AddAzureRedis("cache")
                   .WithAccessKeyAuthentication();

This causes:

  • Loss of cached data in Redis instances
  • Connection string mismatches in dependent services
  • Need to manually set persistent passwords via user secrets

Scenario 3: ParameterResource Re-prompting

The implementation will also reprompt for any ParameterResource instances that are referenced in the AppHost, which introduces additional friction:

var apiKey = builder.AddParameter("api-key", secret: true);
var storageAccount = builder.AddParameter("storage-account-name");

Users must re-enter these parameter values on every deployment, even when the values haven't changed.

Implementation Notes

When evaluating solutions we should consider that:

  • The deployment state should be queryable from the AppHost so that custom deployment implementations can query it.
  • azd has an existing mechanism for managing deployment state. We should consider interoping whether or not we ewant to interop with it.
  • Deployment state should be scoped to a certain environment/scope. We'll need to figure out how users define the environment/scope that a given deployment is associated with.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions