Need Minimal Permissions for DacPack Deployment in VS 2019

Ahwan Mishra 40 Reputation points
2023-09-13T15:16:05.3433333+00:00

Hello everyone,

I'm facing a situation where I need to transition from having dbOwner permissions to a more restricted set of permissions in order to publish a DacPack for my Database project using Visual Studio 2019.

Currently, my user, 'newlogin,' has been granted the following permissions: ddlAdmin, dbReader, and dbWriter.
User's image

However, when attempting to publish with the permissions mentioned above, I encounter the following errors:

1.An error occurs while attempting to alter the database.

User's image

2.There is an issue with creating a schema with dbo authorization.
User's image

I'm seeking guidance on what would be the minimal set of permissions required for a successful deployment of the DacPack. Your insights and suggestions would be greatly appreciated.

Azure SQL Database
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,810 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,001 questions
{count} votes

2 additional answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 21,481 Reputation points Microsoft Employee
    2023-09-15T11:11:43.3+00:00

    Hi @Ahwan Mishra To publish a dacpac and modify the database schema, the user needs DDL write permission to edit the database. If the user is publishing to a non-existent database, they must have permission to create a new database, otherwise, an error will occur.

    Are you able to create a db in that server?

    Regards

    Geetha

    0 comments No comments

  2. Ahwan Mishra 40 Reputation points
    2023-09-27T11:14:10.98+00:00

    Hi All,
    I could resolve the above issues, the solution is as follow.

    Q1. An error occurs while attempting to alter the database.

    Ans- GRANT ALTER ON <Database>

    Q2. There is an issue with creating a schema with dbo authorization.

    Ans - assigned user an additional role of db_accessadmin

    0 comments No comments