Create a SQL Server Windows VM
How to create a Virtual Machine in Azure with Windows SQL Server.
Create a SQL Server Windows VM
In Azure, search for Azure SQL.
Change the size settings to your desire configuration. The settings below are for testing/trying things out.
- Click Create
- On
SQL virtual machinesselect an image such asFree SQL Server License: SQL Server 2022 Developer on Windows Server 2022 - Click Create
- Select a resource group
- Enter a name like
sqlserver - Choose the lowest size with 4GB like
Standard B2s -2 vcpus, 4GiB - Enter user/pwd
- Public inbound ports. Keep RDP.
- Licensing
- Don’t select
Would you like to use an existing license?if you don’t have one.
- Don’t select
- In
Diskstab selectStandard SSD - In
Networkingtab- If using a specific virtual network
- Select the virtual network
- Subnet
default
- If using a specific virtual network
- In
Managementtab- Enable
Auto-shutdownif you want to make sure to stop the VM every day.
- Enable
- In
SQL Server Settingstab- SQL Connectivity (If using a private vnet:
Private (within Virtual Network)) - Port
1433 - SQL Auth set to
Enable- The default is to login using the same VM credentials
- SQL Connectivity (If using a private vnet:
- In
Storage configurationtab- Leave default for an actual prod env
- For this blog post I lowered the settings.
- Change configuration
- Data storage,
Disk typechange to a lower setting like16 GiB - Log storage, change to
share the data drive for log
- The
SQL Server Licenseshould beNo - Click
Review and create - Select
Create
After provisioned:
- Go to networking
- Select RDP
- Change
SourcetoMy IP Address(Or select a different option)
Load a sample database in SQL Server VM
RDP to the SQL Server VM and download the sample database.
Go to the Adventure Works Microsoft website here and download the latest AdventureWorksDW file. For this tutorial I downloaded AdventureWorksDW2019.bak.
- Copy the
bakfile to this directoryC:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup - Open SSMS
- Connect to
localhost - Right click
DatabasesthenRestore Database - Select
Deviceand browse to thebakfile - Click OK
- Then the
Databasefield should populate the nameAdventureWorksDW2019 - Click OK to restore
- Close SSMS
- Close the RDP connection to the SQL Server
Use choco to install programs with Powershell
See Use Chocolatey in Windows Powershell to Install Programs
Optionally install:
- SSMS
- Notepad++
- Azure Data Studio
