Configuring Integrated Security for a TeamCity SQL Database December, 2013
Configuring integrated security for a TeamCity database is pretty simple but if you don’t get it just right you’ll get this error without further explanation:
SQL error when doing: Connecting to MSSQL: This driver is not configured for integrated authentication.
Here is how to set it up:
Note: I’ll be refering to the TeamCity home and data directories. Typically they will be under C:\Program Files\TeamCity but may be under different paths on your system. See here and here for more info.
- Download the Microsoft JDBC Driver for SQL Server and extract the files.
- Copy the
\sqljdbc4.jarfile to the<TeamCityDataDir>\lib\jdbcfolder (You will have to create thejdbcfolder).
If you are running a 32 bit OS:
- Copy the
\auth\x32\sqljdbc_auth.dllfile (Note thex32in the path) to the<TeamCityHomeDir>\binfolder. - Restart TeamCity server and agents.
If you are running a 64 bit OS:
- Copy the
\auth\x64\sqljdbc_auth.dllfile (Note thex64in the path) to the<TeamCityHomeDir>\binfolder. - Download the 64 bit Windows
tar.gzversion (Not the installer) of the JRE here and uncompress it. Depending on your compression tool you may have to then extract the files from the tar archive (Which may not have an extension) as a second step. 7-zip will do this. - Delete the contents of the
<TeamCityHomeDir>\jrefolder. - Copy the JRE that you extracted in the previous step to the
<TeamCityHomeDir>\jrefolder. The JRE is one folder deep in the archive so don’t just directly copy the folder that is extracted. Your<TeamCityHomeDir>\jrefolder should contain abinandlibsfolder. - Make a backup of your
<TeamCityHomeDir>\jrefolder under<TeamCityHomeDir>\jre\x64(Or wherever you prefer). TeamCity upgrades overwrite the the JRE with the 32 bit version, so you’ll want to have a copy handy so you can replace it after updates. - Restart TeamCity server and agents.
As mentioned above when you upgrade TeamCity, the jre folder is overwritten with the 32 bit version of the JRE. So if you’re using the 64 bit version this will lead to the following error when you restart:

You will need to stop the TeamCity server and agents, replace the x32 version with the x64 version as described above, and restart the services.
Thanks to dneelyep for his corrections.

Bender (51 )