-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Idea] .NET Aspire Integration #584
Comments
Yeah, I have been thinking the same, some kind if synergy here seems useful. |
Perhaps something like: var databaseProject = builder.AddProject<Projects.MyDatabaseProject>();
var db = builder.AddSqlServer("sql")
.AddDatabase("db")
.WithDatabaseProject(databaseProject) Which would then result in a running SQL Server container named |
Do you mean WithDatabaseProject(databaseproject) ? |
That would be the main API yes. Of course the hard part is figuring out what that is going to do. It would probably involve running sqlpackage somehow. Not sure if that is included in the SQL containers though |
Sqlpackage is easy to install: dotnet tool install Microsoft.SqlPackage With a connection string, would it be needed inside the container? (It only runs on certain Linux distributions) |
I guess we could use a locally installed sqlpackage. We can get the connection string from the SQL resource and I'm guessing we can get the path to the dacpac from the project resource. If we can put those together we can make it work. Might be able to throw some early prototype together on Friday. |
I have been thinking about ASPIRE0004 and reading about resource references in the apphost. Maybe what we really want to do is some thing like this? var builder = DistributedApplication.CreateBuilder(args);
builder.AddSqlServer("sql")
.AddDatabase("test")
.WithDaccpac("MyDacpac");
builder.Build().Run(); The WithDacpac extension method then has some clever ways of finding the location of the specified dacpac and publishing it. Could be a .dacpac included as content, even pointing to another folder in the solution? Could be a MsBuild.Sdk.Sqlproj project in the solution?
|
I can see the use case of having an arbitrary Being able to reference a NuGet package build by Not so sure if it makes much sense though when your |
Agree the nuget option seems cumbersome and anti "inner loop" |
Stumbled upon this: dotnet/aspire#1696 - I think we are not blocked in the same manner. |
And this from one of the Aspire architects: dotnet/aspire#2511 (comment) |
@jmezach Time to close this 🥳 ?? |
@ErikEJ Yes! We have decided to add this integration to the CommunityToolkit for Aspire. Thanks to everyone who has helped us shape this feature. We highly recommend migrating to the CommunityToolkit version of this integration. |
I just had a completely random thought that perhaps could be interesting. Would it be useful to have some kind of integration with .NET Aspire where one could spin up a SQL Server container and deploy a MSBuild.Sdk.SqlProj project to it.
Definitely interested in what @jeffrosenberg and @ErikEJ think, but if you're a user of this project please let us know if this would be interesting 🤔
The text was updated successfully, but these errors were encountered: