The Simplest Way to Make Azure Active Directory and Drone Work Like They Should
Teams link azure active directory and drone to check user identities before running builds. This setup lets developers log in with work accounts and trigger build pipelines. Your identity system manages who can view repos and start jobs. The build server reads those group rules to permit or block each action. How login and permissions flow in azure active directory and drone Drone does not store its own user list by default. It relies on your Git host or an identity provider to check users.
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 link azure active directory and drone to check user identities before running builds. This setup lets developers log in with work accounts and trigger build pipelines.
Your identity system manages who can view repos and start jobs. The build server reads those group rules to permit or block each action.
How login and permissions flow in azure active directory and drone
Drone does not store its own user list by default. It relies on your Git host or an identity provider to check users. Most teams link their Git host to Azure Active Directory first. Then they link Drone to that Git host through standard OAuth tokens.
When an engineer logs into Drone, the request goes to the Git system. The Git system checks the user state with Azure Active Directory. Once the check passes, Drone gets a token with the user permissions. Drone then syncs the repo list that the user can read or write.
Pipeline runners also need rights to talk to cloud hosts and databases. Teams often register a service identity in Azure Active Directory for the runner. The runner uses that identity to pull code, build containers, and push updates.
Common failure modes and how to scope roles
The biggest risk in this setup is a shared service account with broad rights. Teams often give the build runner one static key for the whole cloud account. If a bad script runs in a build, it can read that static key. The script can then change cloud hosts or read private data.
Long-lived tokens in Drone secrets create another major risk for your team. People leave keys in repo settings and forget to rotate them. When an engineer leaves the company, those shared keys often stay active. Unlogged queries from build jobs also make audits very hard to finish.
Active Directory + Azure RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, give each repo or team its own service identity. Scope each role to only the exact resources that specific build needs. Set short lifetimes on all tokens so old keys expire fast. Restrict network paths so runners only reach the hosts they must update.
Auditing build jobs and secret usage
Security teams need clear logs of every action a build job takes. Standard build logs show script output, but they miss database queries and cloud calls. You must link the user identity from the commit to the build run.
Set up Azure Active Directory logs to track every service login event. Match those login timestamps with your Drone build numbers for a full audit trail. Mask sensitive fields like emails, phone numbers, card numbers, or national IDs in logs. Masking rewrites matched fields in results so sensitive strings do not leak in plain text.
Review role assignments every month to remove unused build permissions. Drop any service accounts tied to old repos that no longer run builds.
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
Can Drone log in users with Azure Active Directory directly?
Drone logs in users through a linked Git host like GitHub or GitLab. You link Azure Active Directory to that Git host to control user logins.
How should Drone runners authenticate to Azure cloud resources?
Use managed identities or workload identities in Azure Active Directory for your runners. Avoid putting static client secrets inside your repo settings whenever you can.
What happens in Drone when we disable a user in Azure Active Directory?
The Git host revokes their active session on the next token check. Drone then blocks the user from viewing builds or starting new jobs.
Related guides
In this post