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.65k stars 416 forks source link

`UserNameParameter` should be populated like `PasswordParameter` on Postgres resource #4099

Open mitchdenny opened 4 months ago

mitchdenny commented 4 months ago

... and possibly other resources, I haven't checked.

At the moment when I do this:

var postgres = builder.AddPostgres("pgsql");

The value of postgres.Resource.UserNameParameter is null but the value of postgres.Resource.PasswordParameter is populated. We should treat the username and password the same way as it makes writing expressions which reference the parameters easier ... example:

https://github.com/mitchdenny/nocodb-aspire/blob/90ddebde4362508c7c4c8358b110d778baa80446/src/NocoDB/NocoDB.Hosting/NocoDBExtensions.cs#L28

mitchdenny commented 4 months ago

/cc @eerhardt just wanted to check on whether there is a reason you didn't populate the username parameter as well (I think you worked on this).

eerhardt commented 4 months ago

See my feedback on https://github.com/dotnet/aspire/pull/4102. One concern I have is that users shouldn't be prompted for a username when they deploy via azd.

mitchdenny commented 4 months ago

See my feedback on #4102. One concern I have is that users shouldn't be prompted for a username when they deploy via azd.

Looks like @vhvb1989 has a solution for that. When we provide a default value, they don't prompt but it can be overridden.

mitchdenny commented 4 weeks ago

related #4100