An Azure relational database service.
Login failed for user '<token-identified principal>' (I have spent many hours exhausting options)
Jonathon Childs
0
Reputation points
Multiple App Service managed identities receive valid Entra tokens that are rejected by Azure SQL with "Login failed for user '<token-identified principal>'" even though:
- The DB user mapping exists with type EXTERNAL_USER
- The user's SID exactly matches the MI's Object ID
- The token's
oidandsubclaims match the SID - The token's
tidmatches the SQL server's Entra admin tenant
I have reproduced with sqlcmd/Invoke-Sqlcmd presenting the token directly.
Production database on the same server accepts MI tokens from the parent App Services with identical setup. Only test slot identities against CDS_Azure_Test fail.
Started ~March 27, 2026.
Azure SQL Database
Azure SQL Database
Sign in to answer