You finally get your GitLab CI pipelines running clean, only to watch them choke when reaching Azure. Tokens expire, permissions mismatch, and suddenly your “fully automated” delivery turns into a help-desk ticket. Every DevOps engineer has lived that little moment of chaos. The fix starts with understanding how Azure Resource Manager and GitLab CI actually fit together.
Azure Resource Manager (ARM) defines and manages infrastructure for your Azure environment, built around declarative templates and tight role-based access control. GitLab CI lives on the other side of the fence, automating build and deployment pipelines from code commit to cloud resource. Pair them well, and you get infrastructure provisioning as code that’s both repeatable and secure. Pair them poorly, and you spend your nights chasing token scopes.
Here’s the basic integration idea: GitLab CI runs jobs using an identity that Azure recognizes. That identity, whether a service principal or a federated OIDC trust, maps to an Azure AD app registration. The app holds permissions to create, modify, or tear down resources through ARM. When the pipeline triggers, GitLab’s runner exchanges short-lived credentials to hit the Azure Resource Manager API directly. No static secrets, no manual logins.
The payoff comes from short-lived, auditable access. Each pipeline run uses fresh credentials and a predictable set of roles. Audit logs show who deployed what, with which version. You get cleaner compliance lines for SOC 2 or ISO 27001 and fewer “who has owner rights on production” mysteries.
If your tokens expire or ARM throws 403 errors, check the OIDC configuration. Make sure the claims from GitLab match the expected Azure audience and subject identifiers. Rotate secrets often if you still rely on service principals. Use managed identities when possible so credentials vanish into the infrastructure itself.