dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.88k stars 469 forks source link

`Aspire.Microsoft.Data.SqlClient` - `AddDatabase` doesn't create database? #4813

Open atrauzzi opened 4 months ago

atrauzzi commented 4 months ago

Is there an existing issue for this?

Describe the bug

When I use .AddDatabase to create an MSSQL database reference, it doesn't appear to create the database when running locally. This results in the connection string I end up getting being invalid, as it embeds the notion of the database within it.

This seems like a break from what I would normally expect which is that it would mimic the behaviour on my workstation of what it might provision "elsewhere".

Expected Behavior

I'd like Aspire to be responsible for ensuring the database is created.

This might require some clever sequencing/ready-detection of resources, as well as some awareness within Aspire around a dependency graph. But perhaps this is already in the works or abstracted?

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

atrauzzi commented 4 months ago

More digging...

Is this probably related? https://github.com/dotnet/aspire/issues/4160

What can we do in the meantime?

sebastienros commented 4 months ago

Duplicate of https://github.com/dotnet/aspire/issues/1170