- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Provisioning a MS SQL Database Instance in Azure
In this hands-on lab, we will practice provisioning an Azure SQL Database (SQL DB) instance two ways. First, we will provision a SQL DB instance using the Azure Portal. Next, we will provision an instance using PowerShell.

Lab Info
Table of Contents
-
Challenge
Create a SQL Database Instance Using the Azure Portal
Create a SQL Database
- Navigate to the "SQL databases" page of the Azure Portal.
- Click Create sql database.
- Configure the following settings:
- Location: East US
- Use SQL elastic pool: No
- Database tier: Standard
- DTUs: 10
- Data max size: 50 GB
- Data source: Sample
Configure Geo-Replication
- Navigate to the SQL database we just created.
- Under Settings, click Geo-Replication.
- Under TARGET REGIONS, select West US.
- In the Create secondary menu, click Target server.
- Create and configure a new server.
- Click Select, then OK.
Encrypt Data at Rest
- Under Security, click Transparent data encryption.
- Under Data encryption, select ON.
Enable Dynamic Data Masking
- Under Security, click Dynamic Data Masking.
- Add a new masking rule with the following settings:
- Schema: SalesLT
- Table: Customer
- Column: EmailAddress (nvarchar)
- Masking field format: Email ([email protected])
- Click Add.
- Click Save.
-
Challenge
Create a SQL Database Instance Using PowerShell
Create a SQL Server
- From the Azure dashboard, click the Cloud Shell icon at the top of the page.
- Click PowerShell.
- Under Subscription, click Show advanced settings.
- Select the same region as your lab provided Resource Group. Under Storage account, select Create new, and enter a unique name in the field below.
- Under File Share, select Create new, and enter a unique name in the field below.
- Click Create storage.
- In the PowerShell terminal window, run the following command to check the Azure subscription:
- Run the following command to check the Azure subscription:
Get-AzSubscription
- Check the resource group and its current location.
Get-AzResourceGroup
- Create a new SQL server.
New-AzSqlServer
- At the
ServerName
prompt, enter a unique name (e.g.,test1990235
). - At the
User
prompt, enter a unique name (e.g.,admin1990235
). - At the
Password
prompt, enter a unique password (e.g.,Test123456
). - At the
Location
prompt, entersouthcentralus
. - At the
ResourceGroupName
prompt, enter the resource group name (found in the output of theGet-AzResourceGroup
cmdlet).
Create a SQL Database
- Run the following command:
New-AzSqlDatabase ` -DatabaseName [DATABASE_NAME] ` -MaxSizeBytes 53687091200 ` -Edition "Standard" -ResourceGroupName [RESOURCE_GROUP_NAME] -RequestedServiceObjectiveName S0
- At the
ServerName
prompt, enter the server name.
Note: Some PowerShell commands take a while to run. If you don't immediately see an output, be patient and wait for PowerShell to finish executing the query (could take 5-15 minutes).
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.