-
Notifications
You must be signed in to change notification settings - Fork 765
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
Where did /opt/mssql/bin/sqlpackage go? #135
Comments
It has been removed temporarily. We are going to be updating DacFx to work on top of dotnet core and then sqlpackage will run on top of the new DacFx. Sqlpackage will also be moved to it's own package or the mssql-tools package. For now you can use sqlpackage on a Windows machine. Sorry for the temporary inconvenience. |
I don't have access to a Windows machine. This makes the mssql-docker image unusable for me. Is there a way I can go back to an older version that does have |
Yes, you can pull/run the mssql-server-linux:ctp2-1 image. |
Here's a couple of other options until we get this available again. Depending on your scenario, these might work just as well.
|
@spinningarrow, can you share more details about your scenario? How are you using sqlpackage? |
I'm also using sqlpackage and had to revert back to ctp2-1. Personally, docker is a beautiful thing in that it allows you to downgrade as quickly/simply as you can. As far as my particular scenario, I use it on my across my team to run our local development environments. My solution uses a mixture mongo and sql and I use docker-compose to stand up all the required infrastructure locally. The workflow is the following. We use Visual Studio along with sql database projects that produce our dacpacs. If someone on the team needs to make a change to the schema, it's as simple as make the change, build the dacpac, then docker-compose, build and up. It's a really great solution. We added two additional developers to the team in the last week and I've never seen anything better in my 15+ years of software development. |
@twright-msft you mentioned that sqlpackage is in progress of an update, do you happen to know the timeline? The reason I ask is because I'm having some issues deploying a rather complicated schema. |
Thanks for sharing your story @pcalchi. Docker is beautiful. I'd be curious to see your Dockerfiles, entrypoint scripts, or docker-compose files if you wouldnt mind sharing them via pastebin or something. Yes, Sqlpackage is getting updated to run on top of the new cross-platform DacFX and to be packaged differently. That doesnt necessarily mean that we will be changing things around how a DACPAC is deployed though. If you want to share the details of that with us via StackOverflow or something we could take a look at it. |
@pcalchi, since you're using Visual Studio and Database Projects to produce the dacpac, is running sqlpackage on Windows to deploy the dacpac to SQL running in Docker an option for your scenario? |
@sanagama @twright-msft, I've also had to pin my Dockerfile to a previous CTP so that I can continue to use sqlpackage. The Dockerfile includes something like:
The resulting image is used in a docker-compose file along with our application code. We can then quickly and easily stand up a fresh database every time we run through our integration tests. I hope this is a useful example for you :) |
Sorry for the awfully late reply everyone, and thanks for chiming in. Here's my update:
@twright-msft This works perfectly for me at the moment. I was looking for something like this, but being new to Docker, I wasn't able to easily find a list of tags for an image. 🙈
@sanagama I was using it to load in a small test database from a bacpac file when the sqlserver container starts, basically in order to have a small database for local development/testing. |
You probably already figured this out @spinningarrow, but for others, if you go to Docker Hub you can see a list of tags on the Tags tab. |
Hi @twright-msft, is there a better place to follow progress on the "new cross-platform DacFX"? I'm not super familiar with the MS ecosystem. Can this be tracked in dotnet/core? We are super excited to be able to use these build tools cross-platform! |
We havent moved dacfx into the open source domain yet so it's hard to follow the progress. We are working on it though... |
with the latest update (2017-GA and 2017-latest) /opt/mssql/bin/sqlpackage executable is gone again. Is it in the image or removed completely? Best, |
Removed completely for now. Will put it back in the next few months. |
ctp-2.1 is about to expire. I am still using sqlpackage and rely on it extensively for deployments. |
We are working on sqlpackage on Linux right now. I've seen it working. Maybe could provide you a preview drop of it. Shoot me a mail at twright @ reallybigsoftwarecompanyname dot com. How much more time do you have left on ctp2-1? |
Thank you, will do. We have ~11 days left in the evaluation period. |
I am in a similar situation we have been deploying using sqlpackage (our whole pipeline builds dacpac files and deploys to docker image with to mssql-docker on linux before running tests after the full env is brought up with docker-compse). We have been doing this for most of the year and are also sweating on the expiry time of ctp2-1, so it would be great if a we could use a preview as well. |
@necrosisbb - ok please contact me through email and I'll see what we can do |
@twright-msft why not to publish the sqlpackage as docker image to docker hub with some 'beta' version tag? |
@twright-msft Will the new sqlpackage (once it hits preview/GA) be added to the tools packages? I would not like to have to install sql server on each dev machine. I prefer hosting dev DBs on one machine and only have the tools like sqlcmd installed on all machines. |
Yes, it will be either in its own package or in the mssql-tools package. We might put it in its own package because it is fairly large and it has a dependency on dotnet core. Input on that decision is welcomed. :) |
@twright-msft , ctp2.1 is going to expire in a few days. Before the new version (including sqlpackage) comes out in a few months, I think it's a good idea to release another evaluation version of ctp2.1 (essentially just to extend expiration), so we can use it without struggling to emailing you to get the preview package, build an image and fix issues. |
Any updates on SqlPackage availability in a container ? |
Still in progress, but if you need an early copy, hit me up. |
Are early test copies available outside a container, preferably as deb package or binary linux tarballs? |
I'm very anxious to see how the dacfx/msbuild/sqlpackage combo could be used to bring an SSDT type experience into VS Code or SQL Operations Studio. My hacked together version is what I've been playing with for the past week or so, but thought I was just missing something on getting it working besides in a Windows environment. |
Hi all! We finally have a preview ready for sqlpackage that is built on dotnet core and is cross-platform! Below are the links to download from. They are evergreen links, i.e. each day a new build is uploaded. This way any checked in bug fix is available the next day. Included in the .zip file is the preview EULA.
For lack of a better method, please provide any feedback you have here on this GitHub issue. Thanks for giving it a try and letting us know how it goes! |
@twright-msft Thanks for posting this. Is there any cross-plat sqlcmd.exe? |
Yes! There is also a new open source command line tool that's super cool and way, way better than sqlcmd in my opinion - mssql-cli. Microsoft engineers are the primary committers on that project. |
thanks again! Which of those has parity with sqlcmd.exe - meaning can directly execute output from: |
@brianjorden here is a test of doing extract, compare, update and scripting in sqlopsstudio command line using legacy sqlpackage & sqlcmd for windows plus cross-plat mssql-scripter: I will try with these cross-plat tools soon. Also please vote for this idea to add SSDT equivalent to sqlopsstudio: |
@twright-msft trying to use the new cross-platform sqlpackage in a docker container. Cannot resolve reference to master.dacpac. I 'm copying master.dacpac together with my primary xxx.dacpac. Sqlpackage outputs the following: How can I get sqlpackage to correctly resolve master.dacpac? |
@tnsholding, there's a known issue at the moment with case-sensitive file systems. I had to change the case to MASTER.DACPAC before sqlpackage could find it. |
@tnsholding , @apboyle - Thanks for reporting this issue. We have a fix in the pipeline for this. |
Great news! Just wondering why there are different packages for each platform? Isn't the whole point of this to use just one package/set of assemblies across platforms? Also, I've noticed there's no README in the (Windows) .ZIP file. As a consumer of Microsoft.SqlServer.Dac.dll, do I have to manually copy all these files in the program's output directory? In general, it'd be easier if you provide a NuGet Package, perhaps in addition to those .ZIP files, so that the users can create local NuGet package feeds and have NuGet take care of any dependencies. |
@moodmosaic - bit of a long story here... sqlpackage is dependent on a library called DacFX which in turn has historically been dependent on the full .NET framework. Of course that just works on Windows. In order to get sqlpackage to run on Linux we had two options - 1) run sqlpackage on the SQL Platform Abstraction Layer (SQL PAL) which also includes full .NET. If you are not familiar with the SQL PAL, please read more about it here or 2) replatform DacFx on dotnet core. Since #1 was relatively easy we did that at first and that was the original release of sqlpackage, but it's not the ideal user experience. We also wanted to make sure that sqlpackage could run on macOS. So, we decided that #2 was the better longer term solution and started working on replatforming DacFX to dotnet core. We have other tools that depend on DacFx and some people develop solutions directly against DacFX so they will benefit from this replatforming too. Now that the native sqlpackage with DacFX is available and runs on dotnet core the experience is much better and you can run it on Linux, macOS and Windows. The packaging is slightly different for each of the different operating systems to provide a familiar installation experience on each platform. The fwlinks that I posted above are just to some raw builds of sqlpackage not the official GA ones. They are there as a preview of what is coming and especially for people trying to use sqlpackage in a Linux container to give us feedback while we are finalizing the release. On Windows, you should be able to download/install the latest official from the download center Good suggestion on the Nuget package. I'm not sure if we have had many requests for that yet, but if there was enough demand for that we could certainly look into it. |
To add on to explanation by @twright-msft, I did want to mention that DacFx does ship via nuget package Microsoft.SqlServer.DacFx.x64. However this package targets the .NET 4.6 framework, and does not yet contain the cross platform DacFx assemblies which target .NET Standard. Updating the nuget package to include the cross platform assemblies is on the road map, but we don't have any specific timelines, so it's probably a few months out. The DacFx nuget package is meant for users that need to use the DacServices API directly, which is not very common since most folks use sqlpackage for .dacpac deployments. To that end, we will publishing sqlpackage .rpm, .deb, and brew packages in the next month or two to simply the acquisition of sqlpackage for non-windows users. |
Is it possible using the fwlinks above to deploy a dacpac file to MS SQL 2017 running native (not docker) on linux? For example:
When i try to do this i get this error: From what i see online this points to a discrepancy between my MS SQL version and the version in the Dacpac. Is this problem possible to solve or do the versions of DacFX prevent this? |
Is this a typo issue? You have ID=sq. Maybe you meant ID=sa? dotnet sqlpackage.dll /Action:Publish /SourceFile:"MyDacpac.dacpac" /p:CreateNewDatabase=false /TargetConnectionString:"Data Source=localhost;User ID=sq;Password=pwd123;Database=MyDB;Pooling=False" |
Thanks for the comments, @twright-msft and @pensivebrian. I'm actually using the DacServices API directly so I'll be looking forward to a NuGet package release for .NET Standard. Meanwhile, I might try to just consume what's inside the nightly builds―if so, I'll let you know how it goes. |
@twright-msft I'm embarrassed to say that the typo was my issue. Thanks! and sorry for wasting your time. |
Thanks @twright-msft #135 (comment) Until an official build is released, I've built an image https://hub.docker.com/r/samuelmarks/mssql-server-fts-sqlpackage-linux: docker run -d -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 --name sqlfts0 mssql-server-fts-sqlpackage-linux
docker exec -it sqlfts0 /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YourStrong!Passw0rd>' -Q 'CREATE DATABASE MyDb0'
docker cp ~/Downloads/foo.bacpac sqlfts0:/opt/downloads/foo.bacpac
docker exec -it sqlfts0 dotnet /opt/sqlpackage/sqlpackage.dll /tsn:localhost /tu:SA /tp:'<YourStrong!Passw0rd>' /A:Import /tdn:MyDb0 /sf:foo.bacpac BTW: If anyone has pointers on implementing Udt, I'm all ears… getting this error from my .bacpac sqlpackage import:
|
We now have some proper sqlpackage documentation, along with installation docs. The install docs have link to the latest sqlpackage builds and call out known issue in the release notes. Going forward, all now builds will be noted in the docs. @SamuelMarks - There a two issues with UDTs at the moment for the cross platform sqlpackage build:
|
Now that sqlpackage is release for Linux and MacOS, I'm going to close out this issue. Thanks to everybody for your patience as we got this figured out and released! |
So is sqlpackage ever actually coming back to the docker image or is it always going to have to be installed on top of it? Neither :latest nor :2019-CTP3.0-ubuntu seem to have it right now. |
@pensivebrian Did sqlpackage ever make it into apt-get on Ubuntu? I'm not seeing it but previous comment in thread indicated it was planned to go there. |
Where is good place to submit issues for linux version of sqlpackage? This thread is as close as I coul find. |
So, it seems like sqlpackage is still not in the Microsoft APT repo nor is it shipping in MSSQL Docker. I know we can just install the Linux version via Dockerfile but why isn't it just available out of the gate? |
Looping in @dzsquared about sqlpackage availability on Microsoft APT. |
For submitting issues on SqlPackage: https://github.com/microsoft/dacfx To install Sqlpackage on linux, including in your own dockerfile:
https://learn.microsoft.com/sql/tools/sqlpackage/sqlpackage-download Having an independent Dockerfile for SqlPackage isn't currently on the roadmap, but do share more about your use case for this on the GitHub repo for DacFx. |
I have a multistage Dockerfile where I build an SDK style Database Project on a dotnet 7 image then copy the DACPACs over to a MSSQL image where I've installed sqlpackage and spin up the database to install the DACPAC before the final image is baked. The MSSQL image doesn't have dotnet installed so I'm installing unzip and downloading the Linux sqlpackage zip package from the evergreen link. Not sure if that's the best way to handle it but it's what I've come up with so far. Then the plan is to attach the container with the updated schema to an existing database. Edit: I'm not actually interested in a Dockerfile specifically for Sqlpackage btw, just having it in Apt or baked into the MSSQL image so it's easier to get at when dotnet is not available. |
I just pulled the latest
microsoft/mssql-server-linux
image and it doesn't appear to have the sqlpackage binary any more. It used to be at /opt/mssql/bin. Was it moved somewhere else?The text was updated successfully, but these errors were encountered: