Skip to content
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

It should be possible to explicitly set sqlproj DACVersion field instead of relying on search for dacpac files #1944

Open
POFerro opened this issue Jul 30, 2024 · 2 comments

Comments

@POFerro
Copy link

POFerro commented Jul 30, 2024

Azure DevOps Extensions

VersionDacpac

Is your feature request related to a problem? Please describe.

I'm trying to update a dacpac version through the pre-build option of VersionDacPac, I have an sqlproj file and that's what I'm trying to update.
With the current implementation the task is searching for tools in path ( visual studio/sqlpackage ), taking tremendous time, and failing if these aren't available on the agent, is searching for dacpac files ( which in fact might exist if there's any "garbage" from previous builds ) and only if it finds none it will update the sqlproj ( which is what I wanted the first place ) which is blazing fast and doesn't require any extra tools installed on the agent.

Describe the solution you'd like

If I had some parameter or different task to call in my case I would specifically say I wanted to update sqlproj file instead of any dacpac that might exist

Describe alternatives you've considered

I Considered using the task to version .net core project file but it requires the project to be from specific SDKs, even if I specified the Microsoft.Build.Sql sdk ( my project is already using the recent sdk style sqlproj ) it fails saying it's not a valid sdk style project

Additional context

No response

@rfennell
Copy link
Owner

rfennell commented Oct 9, 2024

Sorry, not sure how I missed this being logged month ago.

This is a duplicate ##1594 - that issue contains a workaround, would that work for you @POFerro

@POFerro
Copy link
Author

POFerro commented Nov 6, 2024

Hi @rfennell ,

Thanks for the answer, I had seen that issue yes, but my case is slightly different in since that I don't want to version any dacpac file, even if by accident they exist on the folders, what I want is just to version the sqlproj itself, before I build it.
For what I see in your code what would work for me would be a way to enter the else block directly, here:
image
Using a boolean input, or pointing directly to the sqlproj file, to direct the task directly to the else block would be the best.
The problem that I have now is that, besides taking too long to complete ( and I'm not even sure if my build agents have SqlPackage installed so I couldn't be sure about the toolsPath to provide ), if the task finds any dacpac on the file structure (ex: a dacpac reference) it will version that file and forget my sqlproj, that is a no go for me.

The workaround I used was version a Directory.build.props file that I added aside sqlproj just for the purpose of containing the Version property, which works but is very ugly :).

Thanks, best regards and congrats on the great tooling you provide, your tasks rock :)
POFerro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants