Microsoft Azure provides a cloud-based SQL Server. It can quickly scale the database up or down depending on your business needs.
In this blog, we will understand how to create a SQL Server in Microsoft Azure portal and use it with Visual Studio code.
Let’s get started.
Create Azure SQL Server:
Log in to your Azure portal, then click on create a resource in the left side menu.
You want to enter a valid database name, subscription, and resource group. I am selecting a blank database. We must configure server name & login credentials so that we can access it over any of the tools and sources.
Next configure the price tier. Recently, Microsoft provided some advanced options for computation.
Once complete, then you will be ready to use the Azure SQL Server
Before connecting to the server, we must Set the Server Firewall.
Allow access to Azure services -- select ON
Now it will show the current IP Address. You can grant access permission to an IP address.
Use with Visual Studio Code
You will download VS Code from here. Open VS code Editor. Then go to Extensions tab, find the SQL and install the one with SQL Server (mssql)
After that click F1 to connect the Azure SQL Server. It will ask for server name, database & login. Finally, enter your profile name to connect.
I received this connection error
I can reset the Azure SQL Server Firewall. This time increase the range of IP addresses.
Now, my Azure SQL Server connection has been established.
Then just run the sample query for testing,
Also, we can monitor our resource utilization.