What should be the time interval between two REST API calls made to TeamCity?

Hi,

I am using TeamCity 2019 On-Premises version.

I am using a ASP.NET MVC Web Application to create a TeamCity Project & configure the build steps using REST API calls.

I am making about 100 REST API calls to TeamCity in ASP.NET MVC Web Application. As a result, the AD account is getting locked.

What should be the time interval between two REST API calls made to TeamCity?

0
1 comment

Hello,

There is no recommended interval between 2 REST API calls as for such cases it depends on the security configuration set on the Active Directory that suits your organization. Also, an important consideration about the authentication of REST API calls is that each REST call will auth against AD and not cache it.

The first recommendation would be to check if there is anything causing the account lock, such as it being used elsewhere with an old or incorrect password, or the account being used in several devices, or any other possible cause. To guide you through this troubleshooting process, i suggest you to go through the following article:
https://docs.microsoft.com/en-us/azure/active-directory-domain-services/troubleshoot-account-lockout

You can also check with your System administrator how you can adjust the Account Lockout Policy to accommodate your MVC App REST API usage and the organization needs:
https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/account-lockout-policy

If you come to the conclusion that you need to introduce a time interval between the calls, my recommendation is that you try to optimize first and try to reduce the number of calls (can you get the same information with a smaller amount of REST API calls?), and then if it is necessary to introduce a time interval, start with a very small interval and gradually increase until it suits your application's needs.

If this doesn't work, a possible workaround for this might also be trying to use personal access tokens, if your TeamCity version supports it:
https://www.jetbrains.com/help/teamcity/configuring-your-user-profile.html#Managing+Access+Tokens . This way auth should stop at teamcity and not get all the way to AD. If you have a small amount of users for your use case, it might be useful.

Please let me know if you have any more questions or concerns,

Guilherme

0

Please sign in to leave a comment.