Sql-docs: sqlpackage RegisterDataTierApplication errors with Azure SQL Database

Created on 27 Feb 2020  Â·  4Comments  Â·  Source: MicrosoftDocs/sql-docs

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


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 assigned-to-author doc-bug sqprod

All 4 comments

@stevef51 -- Steve, thank you for your feedback. You may find answers here:

@pensivebrian -- Brian, please look into this issue #4230.

cc @stevestein as a writer

I am having exactly the same errors during my attempts to run sqlpackage 18.4.1 / 18.3.1 utility on Linux and to use the option '/p:RegisterDataTierApplication=true'.

I've checked in the fix for this which will be available in sqlpackage 18.6, the next planned release. Hopefully this release will be available later this month (end of August).

@stevef51 , @artazar - thanks for the feedback.

We're going to close this documentation issue and track it here.

Thanks!

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlundy picture rlundy  Â·  4Comments

eliotg picture eliotg  Â·  3Comments

mverbaas picture mverbaas  Â·  3Comments

samrueby picture samrueby  Â·  3Comments

GeorgeTsiokos picture GeorgeTsiokos  Â·  4Comments