-
Notifications
You must be signed in to change notification settings - Fork 41
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
[Feature] Allow setting DacDeployOptions in DacpacDeployer when publishing SqlServer porjects from dacpac #282
Comments
I agree that this would be a very useful feature to have and should be fairly easy to add. Not sure when I'll have time to add this, but if anyone wants to take a stab at it feel free to create a PR |
I can give it a go. Any comments as to the design? I would also like to try parsing mirrored settings values from the sqlproj file as is done for the dacpacpath. |
Since we need an instance of |
I like this, alternatively adding a overload with a My thinking behind using a parameter approach is that future usages of But that is just speculation. Script based deployments are already possible with the core SqlServer integration. |
I just realized that |
Deploy dacpac is very easy. As Someone mentioned, you need the
Having ".WithDacPac()" in SqlServer ApplicationBuilder would execute the deployment every time. But the biggest issue is how to pass the dacpac. Conclusion: |
Our organisations "normal", actually does include always deploying updated dacpacs to publish the latest schema differences every time. We do have the same annoyance with the Publish dialog which appears when you launch the Apphost project from the VS menu. Another problem we have, is when using the new beta Microsoft.Build.Sql SDK for the database project. Generally, what you want to achieve with manual scripts is actually possible using the core .Net Aspire packages. |
Documentation for new WithConfigureDacDeployOptions extension. Related to issue CommunityToolkit/Aspire#282 and PR CommunityToolkit/Aspire#286
* Update hosting-sql-database-projects.md Documentation for new WithConfigureDacDeployOptions extension. Related to issue CommunityToolkit/Aspire#282 and PR CommunityToolkit/Aspire#286 * Apply suggestions from code review --------- Co-authored-by: David Pine <[email protected]>
Background
I'm working in a project where we have a base dacpac with common schema elements for multiple instances of different databases building on top of the common schema elements. The dacpac is referenced as a PackageReference in the SqlServer project and normally published with the
IncludeCompositeObjects=true
option to deploy alle schema elements required.As we attempt to adopt .Net Aspire, we are not easily able to do this without re-implementing the functionality of the
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects
package only to override the use ofnew DacDeployOptions()
inDacPacDeployer.Deploy()
.It seems like a very usable feature to allow modifying the many
DacDeployOptions
properties passed to the Deploy operation for the dacpac in question.Proposal
I thus propose an overload of the WithDacpac extension method for
SqlProjectResource
resource builders to set a newDacDeployOptionsMetaDataAnnotation
which can be picked up when deploying the dacpac in theSqlProjectPublishService
class.Alternatively, the
DacDeployOptions
can be created and populated with supported property values from the sqlproj file in a newGetDacDeployOptions
method in theSqlProjectResource
class similar to how theSqlTargetPath
andTargetPath
are attempted read in theGetDacpacPath
method.Help us help you
Yes, I'd like to be assigned to work on this item, but am new to contributing on github.
The text was updated successfully, but these errors were encountered: