dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.37k stars 349 forks source link

Support pre-provisioned configuration for azure resources #2395

Open davidfowl opened 4 months ago

davidfowl commented 4 months ago

We removed the ability to specify a connection string directly for arbitrary resources now that we have the AddConnectionString method. This adds a bit of friction when you want to directly specify the information for pre-provisioned to be used in development, while still allowing them to be provisioned during deployment.

davidfowl commented 4 months ago

Moving this to preview 5. The preview 4 mode of operation will be something like this:

var keyVault = builder.ExecutionContext.IsPublishMode ? 
        builder.AddKeyVault("kv") : 
        builder.AddConnectionString("kv");

builder.AddProject<Projects.Api>("api").WithReference(kv);

We'll add the ability to use an existing resource in preview 5

mitchdenny commented 3 months ago

For GA we'll do use AddConnectionString(...).