Azure SQL Database for part of its migration. & creating the database.
you'll create a SQL database in Azure and then query the data in that database.
In this task, you'll create a SQL database based on the AdventureWorksLT sample database.
1.Sign in to the Azure portal.
2.Select Create a resource > Databases > SQL database. The Create SQL Database pane appears.
3.Enter the following values for each setting.
The Create SQL Database Server pane appears.
- Enter the following values for each setting.
Complete the remaining fields for Create SQL Database using the following values.
- Select Next : Networking, and configure the following settings (accept defaults for fields not specified).
Select** Review + create** to validate configuration entries.
Select Create to deploy the server and database. It can take approximately two to five minutes to create the server and deploy the sample database. The deployment pane shows the status, with updates for each resource that is created.
When deployment is complete, select Go to resource. The db1 SQL database Overview pane shows the essentials of the newly deployed database.
In the command bar, select Set server firewall. The Firewall settings page appears.
Check the box next to Allow Azure services and resources to access this server at the bottom of the page, leaving other settings as default.
Select Save to update firewall settings, then close the Firewall settings pane.
In this task, you'll configure the server and run a SQL query.
- In Azure resources menu, select All resources. Search for and select the SQL database resource Type, and ensure that your new database was created. You might need to refresh the page.
2.Select db1, the SQL database you created.
3.In the SQL database menu,** select Query editor (preview). The Query editor (preview)** pane appears.
- Sign in as sqluser, with the password Pa$$w0rd1234.
You will not be able to sign in because your IP address needs to be enabled in a firewall rule.
- In the Query editor menu, select Overview (your edits will be lost), and in the command bar, select Set server firewall. The Firewall settings page appears.
6.In the Client IP address section, your IP will be shown (verify that it is the same client IP address from the error you received in the previous step).
7.In the command bar select Add your client IPv4 address. This will add a Rule name that contains your IP address in both the Start IP and End IP fields.
- Select Save to save this firewall rule.
Select your db1 database in the breadcrumb at the top of the page to return to your SQL database, and then select Query editor (preview) from the menu.
Sign in again as sqluser, with the password Pa$$w0rd1234. This time you should succeed. It might take a couple of minutes for the new firewall rule to be deployed. If you still get an error, verify the client IP address in the error, and return to Firewall settings to add the correct client IP address.
After you sign in successfully, the query pane appears. Enter the following SQL query into the editor pane.
SELECT TOP 20 pc.Name as CategoryName, p.name as ProductName FROM SalesLT.ProductCategory pc JOIN SalesLT.Product p ON pc.productcategoryid = p.productcategoryid;
12 .Select Run, and then review the query results in the Results pane. The query should run successfully.
Congratulations! You've created a SQL database in Azure and successfully queried the data in that database.