The Simplest Way to Make Airflow and Microsoft Entra ID Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing airflow and microsoft entra id lets teams manage workflow login with company accounts. This setup maps directory groups to role rules for running and viewing data tasks. Data teams run many daily jobs to move and clean records. Without central user rules, admins must make local accounts for every engineer. Connecting your workflow app to your central directory fixes this login gap. Engineers log in with their work email and get the right role right away. When someone leaves the team, re

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.

Pairing airflow and microsoft entra id lets teams manage workflow login with company accounts. This setup maps directory groups to role rules for running and viewing data tasks.

Data teams run many daily jobs to move and clean records. Without central user rules, admins must make local accounts for every engineer. Connecting your workflow app to your central directory fixes this login gap. Engineers log in with their work email and get the right role right away. When someone leaves the team, removing their directory user blocks their workflow login too.

How airflow and microsoft entra id share login and roles

The link between airflow and microsoft entra id uses standard web login flows. First, an admin registers the workflow web app inside the central directory. The directory gives the app a client ID and a secret key. Next, the admin sets up the workflow web server to trust the directory.

When an engineer opens the workflow page, it sends them to the directory login screen. The directory checks their password and second factor. Then it sends a signed token back to the workflow web server. This token holds the user email and a list of group IDs.

The workflow web server reads those group IDs during login. It matches each directory group to a built-in role like viewer, user, or admin. Viewers can only check job status and read task logs. Users can trigger jobs and clear failed steps. Admins can edit secret store entries and change system rules. This mapping keeps role management inside one central directory.

Common failure modes and how to scope roles

Many teams stop after they set up web login for users. That leaves big security gaps inside the data tasks themselves. A common mistake is giving every engineer the admin role by default. If a directory group maps to admin, anyone in that group can read stored keys. You should create separate directory groups for viewers, operators, and platform admins.

Shared service accounts cause another big problem in production. Workflow tasks often use one shared database user to run every query. When a bad query locks a table, database logs only show the shared account name. You cannot tell which job or engineer caused the issue. Even worse, these shared keys often have broad write permissions across whole databases.

Microsoft Entra ID (Azure AD) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Long-lived secrets stored inside the workflow database also create high risk. Anyone who can write a task script can print those secrets into task logs. To reduce this risk, scope each job role to the smallest set of tables. Give read-only database roles to reporting jobs and limit write roles to ingestion tasks. Keep network paths tight so worker nodes only reach the databases they need.

You should also watch out for unlogged database queries run during debugging. Engineers often open a shell on a worker node to test a broken script. From there, they use the worker keys to query production tables directly. These manual actions bypass the web login checks and leave no clear audit trail.

Separating human login from task permissions

Good setup separates what a human can click from what a task can read. Directory groups should only control what a person sees in the web interface. They should not give people direct network paths to production databases.

When an engineer needs to inspect data or fix a failed job, track their identity. Map every query back to the person who ran it. If sensitive fields like emails, phone numbers, or card numbers exist, mask them. Data masking rewrites matched fields in results so raw values do not leak into logs. Rotating task keys often and logging every query keeps your data pipeline safe.

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 do directory groups map to workflow roles?

The directory token includes group IDs when a user logs in. The web server matches those IDs to local roles like viewer or admin.

What happens when a user leaves the company?

Admins disable the user account in the central directory. That user can no longer log in or get a new session token.

Does web login secure the database keys used by tasks?

No, web login only checks users entering the web interface. You must scope and audit the database sessions used by worker tasks separately.

The query runs. The emails stay hidden.