Creating Azure AD User Login in Azure SQL

Guru Karnik 41 Reputation points
2020-11-05T14:51:29.973+00:00

I was able to create the user for the managed identity

CREATE USER [mi-adventureworks2017-appuser]
FROM EXTERNAL PROVIDER

I'm unable to create a login for a managed identity in Azure SQL using the below syntax having logged in as the sql server admin as set in the Azure Portal.

CREATE LOGIN [mi-adventureworks2017-appuser]
FROM EXTERNAL PROVIDER

Am I missing something or is this supported only in Managed Instance?

Azure SQL Database
{count} votes

Accepted answer
  1. Vaibhav Chaudhari 38,916 Reputation points Volunteer Moderator
    2020-11-06T04:07:21.183+00:00

    I think, Just creating the user should be fine. This user can be used to connect to DB using code as shown in below 2 blogs

    https://techcommunity.microsoft.com/t5/azure-sql/azure-ad-service-principal-authentication-to-sql-db-code-sample/ba-p/481467

    https://techcommunity.microsoft.com/t5/azure-database-support-blog/lesson-learned-49-does-azure-sql-database-support-azure-active/ba-p/369055

    Edit #1

    For Managed Identity access, see if this helps

    https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi#use-managed-identity-connectivity

    ----------

    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.