Hi Karlo,
This usually happens due to time drift between your Azure instances or because Session Affinity is turned off across multiple instances.
A few quick things to check:
- Azure Clock Sync: Ensure time sync is accurate across all instances, as even a few seconds of drift causes TOTP validation to fail randomly.
- Clock Skew Tolerance: Increase the allowed time window/tolerance in your 2FA settings slightly to account for minor time differences.
- Session Affinity / Distributed Cache: If token states are stored in local memory instead of a distributed cache (like Redis), requests hitting different instances can fail.
Hope this helps!