In the third dropdown, select a Resource group or create a new resource group by clicking on "Create new". Let's create a new resource group and click OK.
In the next dropdown, select a database source. We created a blank database.
Now, click on "Configure required settings" and create a new server.
- In the first textbox, enter the server name.
- Enter the login name.
- Add Password and Confirm Password.
- Select a location.
Add the details and click "Select". The server is created.
Now, click on the "Create" button, wait for a few minutes, and click on the notification icon.
The database is created successfully. Now, click on "Go to source" or click on "All Resources" in the left menu bar and check demo. One database is created.
Now, click on Query editor (preview) and enter login details. In query edtior let's create a demo table and insert some values in the table
- create table TblDemo(Id int,Name varchar(50),City varchar(50))
- insert into TblDemo values(1,'Sanwar','Jaipur')
- insert into TblDemo values(1,'Demo','Demo')
Now check the data in table,
select * from TblDemo
Data is inserted successfully in the table,
In the same way, we can create View and procedures.
Now, connect this SQL Azure Database to SQL Server Management Studio. Open SSMS and copy the server name from Azure Portal,
Add server name in SSMS and enter the Login Id and Password.
Click on the "Connect" button. Well, we get an error.
To solve this error, go to the Azure portal and click on "Set server firewall" tab.
Now, click "Add client IP" and save.
Server firewall is updated successfully. Now, go to SSMS and click on "Connect".
Now, the SSMS is connected to the Azure SQL Database. Check the database and table.
Summary
In this article, we learned how we create a database in the Azure Portal and connect Azure Portal to SQL Server Management Studio.