microsoft / microsoft/aspire

Support aspire secret set for deployment environments

Open
#17,184 1 comment 4 reactions 0 assignees View on GitHub
area-deployment triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

## Summary

`aspire secret set` currently behaves as a local/development convenience, but deployment scenarios need a way to provide the same AppHost configuration/secret values for non-development environments.

## Problem

When deploying an Aspire app, especially a TypeScript AppHost or a non-interactive CI/local deployment, values set with `aspire secret set` are not a reliable deployment parameter mechanism. Agents and users have to switch to environment variables such as `Azure__SubscriptionId`, `Azure__Location`, `Azure__ResourceGroup`, and `Parameters__*` on the `aspire deploy` process.

That works, but it creates a gap:

- `aspire secret set` looks like the natural command for setting AppHost values.
- The values are only useful for local/dev behavior today.
- Deployment/non-interactive flows need separate environment-variable plumbing.
- It is not obvious when a value should be set with `aspire secret set` vs passed to `aspire deploy` as environment variables.

## Example scenario

A TypeScript AppHost deployment to Azure App Service needs deployment settings and parameters before running:

```bash
Azure__SubscriptionId="" \
Azure__Location="westus2" \
Azure__ResourceGroup="my-app-rg" \
Parameters__api_key="" \
aspire deploy --apphost ./apphost.ts --environment Production --non-interactive
```

Using `aspire secret set` for these values appears successful, but does not provide a complete deployment/environment-specific secret story.

## Desired outcome

Aspire should support setting AppHost secrets/configuration for deployment environments, not just local development. Ideally users could set values for an environment in a first-class way and have `aspire deploy --environment ` resolve them without requiring ad hoc process environment variables.

Possible shape to explore:

```bash
aspire secret set --environment Production "Parameters:api_key" ""
aspire secret set --environment Production "Azure:SubscriptionId" ""
```

The exact command shape is open, but the key requirement is that deployment environments have a clear, first-class way to store and resolve deployment secrets/configuration.

Contributor guide

Open the contributing guide

Research direction

Start with the `aspire secret set` and `aspire deploy --environment` command flows, including non-interactive deployment and the TypeScript AppHost scenario. Define how environment-scoped values such as `Azure:SubscriptionId` and `Parameters:api_key` are stored and resolved, then verify that deployment no longer requires ad hoc process environment variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, typescript
Domain
cli, cloud, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.