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

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use airflow and teamcity together to link data jobs with code builds. TeamCity tests and packs your code, while Airflow runs your data tasks on time. When you pair both tools, code changes flow straight into your live data jobs. A good build in TeamCity can start a new run in Airflow right away. Or, an Airflow task can call TeamCity to start a fresh build job. This setup keeps your code tests and your data pipelines in sync every day. How airflow and teamcity share tokens and data Both

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.

Teams use airflow and teamcity together to link data jobs with code builds. TeamCity tests and packs your code, while Airflow runs your data tasks on time.

When you pair both tools, code changes flow straight into your live data jobs. A good build in TeamCity can start a new run in Airflow right away. Or, an Airflow task can call TeamCity to start a fresh build job. This setup keeps your code tests and your data pipelines in sync every day.

How airflow and teamcity share tokens and data

Both tools talk to each other over web calls using standard web keys. TeamCity holds a secret key that lets it call the Airflow web service. When a build finishes, TeamCity sends a small web message to start a workflow. Airflow checks the key, reads the message, and starts the right data tasks.

The flow also works the other way around for data teams. An Airflow task can hold a TeamCity token to start a specific build job. The task sends the build request and waits for TeamCity to finish the work. TeamCity runs the build steps and sends a status code back to Airflow. If the build fails, Airflow stops the pipeline and alerts the team.

Data passed between the two tools should stay very small and clean. Pass only build numbers, git commit hashes, or file paths in your web calls. Never send raw user data like emails, phone numbers, or card numbers across tools. Store large data files in cloud buckets instead of passing them in web calls.

Common failure modes and how to scope roles

Many teams make the mistake of using one master account for all jobs. If a shared admin token leaks, an attacker can run any build or pipeline. Long-lived keys sitting in plain text settings also create a huge risk. Another common bug happens when network timeouts leave jobs stuck in a waiting state.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix these issues by setting strict rules for every single role. Give TeamCity a role in Airflow that can only start one specific workflow. Do not let that role read other workflows, change settings, or delete old logs. In TeamCity, create a user role that only runs one target project.

Keep your network paths tight between the build server and the workflow runner. Put both tools in a private network and block public web traffic to them. Set clear timeout limits on every web call so stuck builds fail fast. Log every web request between the two systems so you can trace who ran what.

Keeping build and workflow logs clean

Both tools write detailed logs during every single build and task run. Sometimes a failed task prints secret keys or user details into the error log. Make sure your tasks strip out secrets before writing output to the console. Good log habits help your team find bugs fast and keep audit trails clean.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Should TeamCity push code to Airflow or trigger tasks?

TeamCity can do both jobs well in a live setup. Most teams use TeamCity to test workflow code and copy files to shared storage. After the files land in storage, TeamCity sends a call to run the task.

How do I stop Airflow from waiting forever on a stuck build?

Always set a hard time limit on the task that waits for TeamCity. If the build takes too long, Airflow should mark the task as failed. This rule frees up worker slots so other data jobs can still run.

Store your tokens in the built-in secret store inside each tool. Never write keys straight into your workflow code or your build scripts. Rotate these keys often so old tokens cannot be used if they leak.

The query runs. The emails stay hidden.