0

I am trying to run sqlpackage from an locally hosted Azure Function inside a Docker container (so Linux), I have downloaded the latest 18.4.1 sqlpackage and running the following :-

sqlpackage /a:publish /sf:./mydb.dacpac /tcs:<my azure connection string> /p:RegisterDataTierApplication=true

which proceeds to connect and upgrade the db (in this case the db is already upgraded) but when it goes to register the data tier application it fails with the following final output and error

Publishing to database 'xxx' on server 'yyy,1433'.
Initializing deployment (Start)
Initializing deployment (Complete)
Analyzing deployment plan (Start)
Analyzing deployment plan (Complete)
Updating database (Start)
Update complete.
Updating database (Complete)
*** Could not deploy package.

Unable to register data-tier application: Cannot get stream with FileMode.Create, FileMode.CreateNew, FileMode.Truncate, FileMode.Append when access is FileAccess.Read.
Cannot get stream with FileMode.Create, FileMode.CreateNew, FileMode.Truncate, FileMode.Append when access is FileAccess.Read.
Time elapsed 00:05:22.80

I have tried the same from my Mac host (also running 18.4.1) and it fails with the same error.

From my Windows box if I run SSMS Data Tier Wizard to perform the same Publish with the same DACPAC, Db and options then it works fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.