You can upload an SSH private key into a project via the TeamCity web interface and then use it in VCS roots configuration or in SSH Agent build feature.
Supported Key Format
TeamCity supports keys in the PEM format only. If your private key uses a different format, it has to be converted to PEM. For example, the Putty private key format (*.ppk) not supported by TeamCity can be converted to the PEM format using PuTTY Key Generator: use the menu Conversions -> Export OpenSSH key.