Database permissions required For TeamCity build on named database
DFinn30
Posts: 2 Bronze 1
Hi,
We are trying to run builds of two different databases in TeamCity using the DLM Automation plugin. One is able to use LocalDB, which works fine. The other needs to make use of a temporary database server for a number of reasons (Linked Server usage, MSSQL Enterprise Editon features etc). This build does not work.
The problem we encounter is 'failed to clean the database', where it attempts to drop users/groups. The cleaning process drops the group that the account running the build is a member of, ergo dropping its own permissions to the database.
What is the standard practice here? It seems like the account executing the build must have server level permissions on the database as opposed to being contained within a group on the database, else it will be dropped. Or can the build process be changed to ignore certain objects, namely the user/group executing the build?
Thanks,
David
We are trying to run builds of two different databases in TeamCity using the DLM Automation plugin. One is able to use LocalDB, which works fine. The other needs to make use of a temporary database server for a number of reasons (Linked Server usage, MSSQL Enterprise Editon features etc). This build does not work.
The problem we encounter is 'failed to clean the database', where it attempts to drop users/groups. The cleaning process drops the group that the account running the build is a member of, ergo dropping its own permissions to the database.
What is the standard practice here? It seems like the account executing the build must have server level permissions on the database as opposed to being contained within a group on the database, else it will be dropped. Or can the build process be changed to ignore certain objects, namely the user/group executing the build?
Thanks,
David
Tagged:
Best Answer
-
Andrew P Posts: 194 Silver 3Hey David,
You would need to set up a Filter to exclude Users and put the path to the filter inside the Build task (under the Filter Path parameter.
During the Build - it is using the Invoke-DlmDatabaseSchemaValidation cmdlet, so the documentation here is also relevant.
If you are already using a Filter to exclude Users in SQL Source Control, then you can reference that path which would look like%system.teamcity.build.workingDir%\filter.scpf
Hope that helps!
Andrew Pierce
Technical Sales Engineer
Redgate Software
Answers
Thanks for your post.
I can see you have a support contract at your organisation. You can generally get a fester reply and investigation in an to an issue via our support team. You could send us a ticket so that an engineer can help you with this.
I hope this helps.
Richard Lynch.
Redgate Software