The Simplest Way to Make Cloud Run and Teamcity Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair cloud run and teamcity to build container images and run serverless apps. TeamCity runs your tests and pushes new container images to Google Cloud Run. This workflow turns code changes into live web services in minutes. Your build agents compile the app and run every test step. Then the build job pushes the container image to a registry. Finally, the pipeline tells the cloud platform to start the new version. Teams get fast releases without managing servers by hand. How cloud run and

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.

You pair cloud run and teamcity to build container images and run serverless apps. TeamCity runs your tests and pushes new container images to Google Cloud Run.

This workflow turns code changes into live web services in minutes. Your build agents compile the app and run every test step. Then the build job pushes the container image to a registry. Finally, the pipeline tells the cloud platform to start the new version. Teams get fast releases without managing servers by hand.

How cloud run and teamcity share identity and data

Your build server needs permission to push images and update cloud services. Most teams start by creating a cloud service account for the build tool. The build agent uses this account to log in and send commands.

Data flows in one clear direction during a normal release. First, the build agent reads source code from your version control system. Next, the agent builds the container image and sends it to cloud storage. After that, the agent sends an update request to the serverless platform. The platform pulls the new image and starts new container instances. Traffic shifts to the new version once health checks pass.

Instead of static keys, you can use workload identity federation. The build server trades its own local token for a short cloud token. That temporary token lasts only for the length of the build step. When the job ends, the token expires right away. You do not need to store long-lived JSON files on build agents.

Common failure modes and how to scope roles

Many teams make the mistake of using one shared service account. They give this single account broad admin rights across the whole cloud project. If an attacker steals that key, they can delete databases or read secrets. Shared accounts also ruin your audit logs. You cannot tell which pipeline or developer changed a live service.

Another common risk comes from open network paths and broad build permissions. Any developer who can edit a build script can run commands on the agent. If that agent holds a powerful cloud key, any developer gains full cloud control. Unlogged script changes can push bad code straight to production.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix this by giving each project its own service account. Grant each account only the exact roles it needs for one service. A build agent only needs rights to push images and update one app. Separate your test projects from your live production projects. Lock down who can edit build steps for live releases. Require code reviews for any changes to your build pipeline rules.

Keeping live services safe during manual checks

Even with good pipelines, engineers still need to check live apps. A release might fail or a container might crash under heavy load. Developers then log in to read logs, check settings, or query data. If you hand out broad project roles for debugging, risk grows again.

Keep manual checks just as tight as your automated build jobs. Give engineers read-only roles for everyday log checks. Tie every action back to a single person, not a shared team account. When someone queries data containing emails or card numbers, mask those fields in results. Clear logs and strict roles keep your cloud setup safe day and night.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How should TeamCity log in to Google Cloud?

Use workload identity federation instead of saved JSON key files. This method trades a build token for a short-lived cloud token. You avoid storing static secrets on your build servers.

What roles does a build agent need for Cloud Run?

Give the build agent permission to push container images to your registry. Also grant the role to update the specific Cloud Run service, plus permission to act as the runtime service account.

How do we stop test builds from changing live services?

Split your test and live apps into separate cloud projects. Give your test build agents roles that only work in the test project. Lock production build steps to protected code branches.

The query runs. The emails stay hidden.