You built a perfect message pipeline on Azure Service Bus. Then someone asked you to automate testing and delivery through CircleCI, and things got weird. Tokens everywhere. Access errors. Secrets leaking into logs at 2 a.m. This post is the fix.
Azure Service Bus moves data between services through topics and queues, built for reliability and at-least-once delivery. CircleCI runs your CI/CD pipelines, designed for speed and repeatability. When combined correctly, they form a powerful workflow that decouples infrastructure tasks from deployment logic. The trick is controlling identity and access without turning your build script into a vault.
The core pattern is simple. Treat Azure Service Bus as an external system your pipeline must authenticate to securely. Use Azure Active Directory service principals or managed identities to issue limited-scope tokens. Then let CircleCI request these tokens dynamically through environment variables or secrets stored in project settings, never as static keys in code. Each job retrieves a short-lived credential when it runs, publishes or consumes from the bus, and deletes the token when finished. No manual rotation, no sticky credentials, no chance a developer pushes a connection string to GitHub.
Most integration failures come from mismatched permissions or missing roles. Map your CircleCI identity to an Azure AD app registration with Azure Service Bus Data Sender or Data Receiver roles. Enforce RBAC at the namespace level. If jobs need to talk across environments, assign them only what they need in each. Token lifetimes shorter than build duration keep everything predictable and auditable.