It wasn’t the code. It wasn’t the QA build. It was Azure AD access control—and it wasn’t wired the same way in test as it was in production. That small gap, the one everyone assumes will “just work,” is where integration tests die and deployments stall.
Setting up Azure AD access control in a QA environment is not just about mimicking production. It’s about building a controlled, correct, and predictable authentication and authorization layer so your testing environment is real enough to expose failures, but isolated enough to protect sensitive data. Too often, QA teams run with partial configs, missing admin consent flows, skipped conditional policies, or mock tokens that bypass the actual login process. This hides the bugs that surface in production when live policies kick in.
The right process starts with matching tenant settings between QA and production. Register your app in Azure AD for the QA tenant. Configure redirect URIs and reply URLs exactly as they are in production, adjusting only the domain to reflect the QA URL. Sync API permissions and grant admin consent in QA just as you do in production. Set up service principals and security groups that replicate real-world access roles. Enable the same multi-factor authentication and conditional access rules so your testers face the same friction users will face later.