We're trying to automate the deployment of databases through development, testing and production. Our approach, using SSDT, is to compare DACPACs from the different environment to generate update scripts, and as a final step, map the correct windows logins to the correct users.
/p:IgnoreUserLoginMappings
Looking at the documentation for SqlPackage.exe there is a property IgnoreUserLoginMappings
that seems to imply that it would ignore mappings, so that they are not included in the dacpac and hence not updated during the comparison and script generation.
But, when we use this property during our extract the users generated are WITHOUT LOGIN, like this in the dacpac:
<Element Type="SqlUser" Name="[Domain\Account]">
<Property Name="IsWithoutLogin" Value="True" />
<Relationship Name="DefaultSchema">
<Entry>
<Annotation Type="PersistedResolvableAnnotation" Name="[Domain\Account]">
<Property Name="TargetTypeStorage" Value="SqlSchema" />
</Annotation>
</Entry>
</Relationship>
</Element>
which is NOT what we want! The subsequent generated update looks something like this:
CREATE USER [Domain\Account] WITHOUT LOGIN
WITH DEFAULT_SCHEMA = [Domain\Account];
Are we doing something wrong or is this a bug, I've searched and can't see much info on this property, is anyone using it that can help, or is there another approach?
Related question: here
"Specifies whether relationships between users and logins will be ignored."
), it appears to work as expected (at least to me).