PowerShell with Azure CLI to Azure SQL using Azure AD Authentication ?

MS Techie 2,701 Reputation points
2021-05-07T15:03:23.11+00:00

I know that Azure SQL supports Azure AD Password authentication and Azure AD Integrated Authentication.

If i want to communicate from my PowerShell (with Azure CLI modules installed) to Azure SQL PaaS , then can i use Azure AD Authentication ? ( Basically i dont want to use SQL authentication and use only Azure AD authentication )

If not Azure AD, can i use Service Principal (created from Azure AD tenant ) to connect from PowerShell to Azure SQL

Azure SQL Database
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,537 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,336 Reputation points
    2021-05-10T11:46:48.517+00:00

    @MS Techie Thank you for reaching out.
    Yes you can use Azure AD authentication with Azure SQL Database from Powershell.

    Please check the articles here and here for detailed instructions.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.

    0 comments No comments

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.