FinOps, DevOps & Reliability Fintech

10Drift Detection in Infrastructure-as-Code (DevOps Governance)

Role: Advisory Solution Engineer

Executive summary

Designed and implemented automated IaC drift detection that compares deployed Azure resources to Terraform/Bicep state and alerts on drift via Teams and email—improving the client's compliance posture.

  • Terraform
  • Bicep
  • Azure Resource Graph
  • Python
  • Azure DevOps
  • Azure Policy
SSituation

A fintech running Azure wanted to ensure their Infrastructure-as-Code (Terraform, Bicep) stayed aligned with deployed resources. Configuration drift was a compliance risk and potential security exposure, so they needed automated detection and alerting.

TTasks
  • Identify tools/features to compare deployed resources vs IaC (Terraform plan in check mode, Azure Resource Graph vs desired state).
  • Where no tool fits, design a custom script to parse IaC and cross-check Azure settings.
  • Integrate drift detection into CI/CD to run regularly and alert via email/Teams.
  • Document best practices to minimize drift (resource locks, policy).
AActions

I recommended Terraform's drift detection where possible and, for out-of-band resources, used Azure Resource Graph queries with Python scripts comparing against a baseline, integrated into a daily Azure DevOps pipeline that emits diffs and Teams/email alerts. A deliberate out-of-band tag change was caught on the next run. I refined scope with their DevOps engineers (some drift is acceptable) and packaged it into a maintainable internal tool.

RResults

The fintech now runs automated drift detection. Since rollout, they have caught manual portal-created resources and remediated them within a day, preventing configuration sprawl. Alerts integrated into their DevOps Teams channel made it part of normal workflow, improving compliance posture, with documentation for extending coverage and integrating Azure Policy.

LLessons Learned

Preventing drift via policy is ideal, but detection is an essential safety net. Tailoring to the client's stack—leveraging existing Terraform—beat introducing new tooling. Lightweight scripting and automation can solve critical business needs effectively.

Solution overview: Drift Detection in Infrastructure-as-Code (DevOps Governance) Drift Detection in Infrastructure-as-Code (DevOps Governance) — flow: Desired state then Detect (daily) then Pipeline then Alert & remediate. DESIRED STATE Terraform / Bicep DETECT (DAILY) Terraform plan (check) Azure Resource Graph Python diff vs baseline PIPELINE Azure DevOps CI/CD ALERT & REMEDIATE Teams + email alerts Remediated within a day Prevention via resource locks & Azure Policy · detection as a safety net
Solution overview — Drift Detection in Infrastructure-as-Code (DevOps Governance) (illustrative; replace with your own diagram anytime)