microsoft / microsoft/aspire

Allow configuration of Azure container app resource allocation in code

Open
#8,735 11 comments 1 reaction 0 assignees View on GitHub
area-app-model area-orchestrator
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

Based on discussion https://github.com/dotnet/aspire/discussions/2069

I would like to configure CPU and memory usage in code (e.g., in `Program.cs`) for Aspire projects, without relying solely on Azure-specific or YAML-based configuration. Currently, there appears to be no built-in way to do this within Aspire itself.

### Describe the solution you'd like

Introduce an API or extension methods in Aspire that let developers specify CPU and memory limits directly in code. This approach would allow local or code-based configuration that mimics production-like settings.

### Additional context

I initially thought this might be possible using [Azure.Provisioning](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Provisioning_1.0.0/sdk/provisioning/Azure.Provisioning/README.md), but after looking more closely, it seems Aspire does not expose CPU/memory configuration in code. Adding such functionality would greatly improve our development workflow.

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.