The Simplest Way to Make Teamcity and gRPC Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using teamcity and grpc together lets build agents call remote services during a pipeline run. TeamCity runs your build steps while gRPC sends fast binary calls to backend apps. This setup helps teams compile protocol files, test microservices, and trigger remote deploys. Build agents act as clients that talk to internal servers over HTTP/2 connections. When you set up this workflow well, builds finish fast and errors show up right away. How teamcity and grpc handle keys, roles, and data flow

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Using teamcity and grpc together lets build agents call remote services during a pipeline run. TeamCity runs your build steps while gRPC sends fast binary calls to backend apps.

This setup helps teams compile protocol files, test microservices, and trigger remote deploys. Build agents act as clients that talk to internal servers over HTTP/2 connections. When you set up this workflow well, builds finish fast and errors show up right away.

How teamcity and grpc handle keys, roles, and data flow

In a standard pipeline, a TeamCity agent starts a job from your source code. First, the agent reads the protocol definition files stored in your git repo. It uses those files to build client code for your target language.

Next, the build step opens a network channel to the remote gRPC server. Most production setups use mutual TLS or bearer tokens so the agent can log in. The server checks the client certificate or token before it accepts any remote call.

Once the server verifies the agent identity, it checks the role tied to that key. The role sets rules on which service methods the build agent can run. Data then flows back and forth as compact binary messages over a single connection.

After the call finishes, the remote service sends a status code back to the agent. TeamCity reads this status code and writes the result into the build log. If the call fails, the pipeline stops and alerts the engineering team.

Common failure modes and how to scope network paths

Many teams start by sharing one static service account across every TeamCity build agent. This creates a major risk because any project can use that same broad key. If one build script leaks the key, an attacker can reach every backend service.

Long-lived tokens also cause trouble when engineers forget to rotate them on a set schedule. A token with wide permissions might let a test job change production data by mistake. Also, raw binary calls often bypass standard text logs, leaving security teams blind.

End-to-End Encryption + gRPC Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, give each TeamCity project its own scoped identity and narrow role. Set up your server rules so a test agent can only call read or test methods. Never let a staging build agent share keys with a production deployment agent.

You should also lock down the network path between your build farm and backend services. Place your build agents in a dedicated subnet with strict firewall rules. Only allow traffic to the exact ports and hosts that your pipeline needs to reach.

Keeping protocol schemas and build agents in sync

Version drift between client code and server code breaks many automated pipelines. If a TeamCity agent uses an old schema file, the remote call may fail. Even worse, the call might pass with missing fields and cause silent bugs later.

You can prevent this by running a schema check step early in the pipeline. Have the build agent compare the new protocol file against the last known version. This check catches breaking changes before the agent tries to call a live service.

Keep your compiler tools locked to one exact version across all build agents. When every agent uses the same tool version, your generated code stays consistent. Clear logs and strict version rules keep your automated builds safe and predictable.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How should TeamCity agents log in to a secure gRPC service?

Agents should use short-lived tokens or client certificates scoped to a single build project. Avoid storing one shared secret across the root project level in your build server.

Why do gRPC calls from TeamCity agents fail with connection drops?

Network firewalls or load balancers between the agent and server often block long HTTP/2 streams. Check that your network devices allow HTTP/2 traffic and keep idle connections alive during builds.

How can teams track which TeamCity build made a specific remote call?

Pass the TeamCity build number and project name inside the request metadata headers. Configure the receiving server to read those headers and write them to your central audit log.

The query runs. The emails stay hidden.