Skip to content
Discussion options

You must be logged in to vote

Required reading https://github.com/dotnet/aspire/blob/main/docs/specs/appmodel.md#values-and-references

For this one, there's no great alternative other than reading the configuration value directly. Though I'm surprised you need the password in the SQL script (why do you need that?).

cc @sebastienros (we need a callback version of WithCreationScript);

var mydb =
    mySqlServer
       .AddDatabase("mydb")
       .WithCreationScript(script.Replace("<MigratorPasswordPlaceHolder>", migratorPasswordParameter.Resource.Value));

For this one, you can use a reference expression to build up the connection string:

var expr = ReferenceExpression.Create($"Data Source=127.0.0.1,{mySqlServer.Resource.P…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vandenbergjp
Comment options

@davidfowl
Comment options

@vandenbergjp
Comment options

Answer selected by vandenbergjp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants