-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add support for deploying dacpacs from referenced NuGet packages #334
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Move targets file into package Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
Add integration test Signed-off-by: Jonathan Mezach <[email protected]>
Signed-off-by: Jonathan Mezach <[email protected]>
3106cb5
to
7f72f70
Compare
@aaronpowell @ErikEJ I think this is ready for review now :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the slightest nitpick in formatting
src/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/SqlProjectBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Jonathan Mezach <[email protected]>
@aaronpowell Do we publish NuGet packages from these PR's? I wanted to make sure that the NuGet package actually contains the MSBuild logic so this will work end-to-end in a real project ;) |
@aaronpowell Never mind, I've downloaded the NuGet packages from the CI pipeline artifacts and added those to a sample project and it all seems to work as expected. So I guess we're good to go here :). |
Now that I've tried this out on my own I'm wondering if we should make a change. Specifically related to the resource being returned by For example, one of the scenarios I'm thinking of using this for is for our "ConfigurationDatabase". This is a central databased used by many of our services which contains a registry of tenants and their associated database(s). So, what I would like to provide is something like this: var builder = DistributedApplication.CreateBuilder(args);
var sqlServer = builder.AddSqlServer("sql");
var configurationDatabase = sqlServer.AddDatabase("ConfigurationDatabase");
var tenantDatabase1 = sqlServer.AddDatabase("Tenant1");
var tenantDatabase2 = sqlServer.AddDatabase("Tenant2");
builder.AddSqlPackage<Packages.ConfigurationDatabase>("ConfigurationDatabase-Schema")
.WithReference(configurationDatabase)
.WithTenantDatabase("Tenant1", tenantDatabase1)
.WithTenantDatabase("Tenant2", tenantDatabase2)
builder.Build().Run(); Obviously this would require implementing a So perhaps we should have |
I see you found it, but also, they are published to the Azure Pipeline feed on PR (main will land on NuGet). |
If there's the potential that you'd want to do different things depending on whether it's a Project or Package based setup, then I'd suggest that we want to return a different type. But if it's possible that there would be methods that would make sense whether it's a Project or Package, should there be an interface that both |
Technically I don't think there is a reason to differentiate between packages and projects. In the end both are based on a My main point though was about being able to differentiate between multiple |
Closes #327
This adds support to the SQL Database Projects integration to deploy a
.dacpac
from a referenced NuGet package. It works by including some MSBuild magic to create classes that inherit from the newIPackageMetadata
interface. This interface exposes the Package ID, Version and the physical path to the package in the users NuGet package cache.We then leverage this metadata at runtime to find the correct path to the
.dacpac
and use the existing infrastructure for deploying said.dacpac
to a target SQL Server.PR Checklist
Other information