microsoft / microsoft/DacFx

Existing table permissions are not re-added when table is recreated

Open
#658 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

- SqlPackage or DacFx Version: SqlPackage 162.1.162.1 from visual studio 2022 install (but also seen on latest version in azure pipeline build agent)
- .NET Framework (Windows-only) or .NET Core: seen on .net framework
- Environment (local platform and source/target platforms): windows, VS 2022

**Steps to Reproduce:**

There may be a flag that i'm missing which fixes this behaviour, but i've looked at the ones in the docs and non have worked. This sounds a bit like the issue https://github.com/microsoft/DacFx/issues/643 but i've tried the suggested IgnorePermissions flag and excluding permissions object type.

Steps to reproduce can be found in [this repo](https://github.com/chestercodes/dacpac-issue-repro) and they are roughly:

1. add SELECT, UPDATE, INSERT, DELETE permissions at table level, in other process where they are not also present in project sql. our company does not include permissions in dacpac projects for various reasons
2. change table in such a way that it is recreated by dacpac, in the reproduction repo this is done by adding a column in the middle of other ones
3. observe that the table permissions are not re-added when the table is dropped and recreated

**Did this occur in prior versions? If not - which version(s) did it work in?**

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Contributor guide

Open the contributing guide

Research direction

Start with the linked dacpac-issue-repro repository and reproduce the SqlPackage/DacFx deployment using table-level SELECT, UPDATE, INSERT, and DELETE permissions. Compare behavior when a table is recreated after adding a column, including the documented IgnorePermissions and excluded-permissions settings; done means existing permissions are restored after recreation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.