-
Notifications
You must be signed in to change notification settings - Fork 84
Description
The documentation states that when ActiveDirectoryManagedIdentity is used, we need to specify the Managed Identity name as the user name in sqlcmd. So I tried:
.\sqlcmd.exe --authentication-method=ActiveDirectoryManagedIdentity -U vm_msi_name -S someserver.database.windows.net
Unfortunately, this errors out with the message The requested identity isn't assigned to this resource
On a hunch, I tried without the -U parameter:
.\sqlcmd.exe --authentication-method=ActiveDirectoryManagedIdentity -S someserver.database.windows.net
... and it worked. So it seems that specifying the managed identity name may not be mandatory. If this is true, can the README / docs be updated?
As a follow up question, if we do need to specify the managed identity name, how can we disambiguate when multiple identities have the same name, but have different client IDs? Can we allow for either the name, or the client ID, being provided to sqlcmd? For example, the Azure Portal Azure Active Directory - All applications blade does allow searching by either name or client ID.