Duplicate name issue when using System Managed Identity with SQL

Jeff Positano 20 Reputation points
2023-02-02T16:23:16.2166667+00:00

We have recently started using System Managed Identities for our app services to access our Azure SQL databases. Our Azure AD app registrations use the same name as the app service, so the application object service principal has the same name as the SMI service principal. When our DBA tries to create the user (i.e. "CREATE USER...") in the database they receive this error.

Principal 'xxxx' has a duplicate display name. Make the display name unique in Azure Active Directory and execute this statement again.

We have found that we can get around this error by temporarily renaming the app registration name on the "Branding & Properties" page, which allows the DBA to successfully execute "create user...". Once this is complete we restore the original app name. While the error message indicates that the display name must be unique, we wouldn't expect to be able to restore the name.

Although our naming standards might be unconventional (to have the same name for the app service and application object), since our workaround essentially allows the SMI service principal object to have the same name as the application object then the "CREATE USER..." command should complete without giving the error, and without having to rename the registration.

Our workaround seems kludgey, so we wanted to know if this behavior is expected or if this could be a bug somewhere.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,392 questions
{count} votes

Accepted answer
  1. Stas Sultanov 150 Reputation points
    2023-03-23T22:30:17.51+00:00

    There is a functionality

    CREATE USER [xxxx] FROM EXTERNAL PROVIDER WITH OBJECT_ID='xxx'
    
    
    15 people found this answer helpful.

0 additional answers

Sort by: Most helpful