Credentilas json and guids query
Hi,
I use TeamCity with Nuke.Build (to define pipelines in C#).
I noticed this concept: https://nuke.build/docs/cicd/teamcity/
When you get a secret from TeamCity, there is a guid or some sort of JSON. How should I configure my secrets in line with this?
Please sign in to leave a comment.
Hi,
TeamCity credentials stored outside of VCS per Versioned settings are stored in the `secure/credentials.json`. We can get GUID and it's value from the credentials.json file.
/config/projects/<projectId>/pluginData/credentials.json
For additional details, please visit the following link: TeamCity Data Directory
>How should I configure my secrets in line with this?
Could you provide more details about your specific requirements or implementation goals?
Additionally, you may find the following references helpful:
Kotlin DSL Documentation
Building CI/CD Pipelines with NUKE
Hi,
Where is that path on a windows agent?
When i say configure my secrets, what I mean is I create parameters which are of type password, as they are meant to be secrets (sensitive values). Is this correct?
Hi,
> Where is that path on a windows agent?
The specified file is located within the TeamCity server not agent. The currently used Data Directory location can be seen on the Administration | Global Settings page for a running TeamCity server instance. The relevant information can be obtained from the link I provided earlier: https://www.jetbrains.com/help/teamcity/teamcity-data-directory.html#Structure+of+TeamCity+Data+Directory.
>what I mean is I create parameters which are of type password, as they are meant to be secrets (sensitive values). Is this correct?
Certainly, the provided value is indeed the secure value. TeamCity employs the BCrypt hashing algorithm to enhance the security of user password storage. Additional details can be found at (https://www.jetbrains.com/help/teamcity/security-notes.html#Credentials)
Hi
I checked the server but still don't see any credentials.json in the data directory of the server?
If your project possesses the necessary credentials, you can also locate them through the UI: Administrator -> Diagnostics -> Data Directory. For additional information, please refer to the attached screenshot.
Actually I realised I had to make the versioned controlled settingso n the project. Is the GUID I want in the Tokens page? It displays two tokens.
Yes, it will generate the GUID in the token page. And we can set the value in the Secure value filed.
Best Regards,
Tom
Hi,
Sorry, I need to revisit this. For the project I was looking at, I see the credentials.json. For a new project, how do I generate this again?
Hi Gurdip,
If you are using versioned settings (https://www.jetbrains.com/help/teamcity/storing-project-settings-in-version-control.html) in Kotlin DSL or XML format, you can add a password-type parameter. This will generate the token in the credentialsJSON file.
ah I enabled the versioned settings and I see the guid now, so that should be all good now?