Sunday, November 25, 2018

Connecting to an Azure Cloud Hosted SQL DB from Visual Studio 2017

Connecting to an Azure Cloud Hosted SQL DB from Visual Studio 2017 is as simple as this.

You must first get your SQL Server DB created in Azure Portal (You must have an Azure Subscription for this.)

If you dont have an Azure Subscription yet, get one here.

Go to SQL Databases in the left hand pane, click proceed and create a SQL DB. You will have to add a server (SQL Server) while doing this.

 Note down the Server Admin Login Credentials of SQL Server for further use.


Once done, Go to VS 2017 and open SQL Server Object Explorer.
Click "Add Server" icon highlighted in yellow.

Following highlighted default values will shown. Get those changed as per the next screenshot.


Change the Authentication to SQL Server Authentication. Provide the credentials of the server you had mentioned in Azure Portal.

All the available databases available in the server will get loaded in the Database Name dropdown.
Select the DB you wanted and Click Connect.
That simple it is.