-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Copy link
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.
Description
We just merged dotnet/aspire#7826 into 9.2 which adds an overload of AddConnectionString that supports passing in a reference expression.
There are a few key things this enables:
-
Creating adhoc connection strings made from various parameters:
var openAiKey = builder.AddParameter("openaikey", secret: true); var oaiCs = builder.AddConnectionString("llm", ReferenceExpression.Create($"Endpoint=https://api.openai.com/v1;Key={openAiKey}"));
-
Appending to existing connection strings.
var builder = DistributedApplication.CreateBuilder(args); var postgres = builder .AddPostgres("postgres") var database = postgres.AddDatabase("db"); var cs = builder.AddConnectionString("database", ReferenceExpression.Create($"{database};Include Error Details=true")); var backend = builder .AddProject<Projects.Backend>("backend") .WithReference(cs) .WaitFor(cs); builder.Build().Run();
Waiting for a connection string will wait for the database implicitly.
This article should be updated to show the new scenarios.
IEvangelist
Metadata
Metadata
Assignees
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.