Get your own AdventureWorks2022 database by deploying .bak to Azure SQL
AdventureWorks has long been a staple for developers and database administrators looking to experiment and demo the capabilities of SQL or Power BI. Now, you can have your own copy of the full AdventureWorks2022 demo dataset. Follow the steps below to deploy the .bak file to Azure SQL.
Steps Covered:
Download .bak file
Install SQL Express (free)
Import .bak to local SQL Express Server
Deploy Adventureworks2022 to Azure SQL
Pre-requisites:
Azure SQL Server
(Deployment guide: Deploy Azure SQL Server)
1. Download the .bak File
Start by downloading the AdventureWorks2022 .bak file. You can obtain it from Microsoft's official website:
๐ Download .bak file
Step 2: Install SQL Express
SQL Express is a free edition of SQL Server, which is perfect for learning and building desktop and small server applications. You can download it from this website:
๐ Download SQL Express
Follow the installation guide. For this use-case it is sufficient to install the โBasicโ install package.
Step 3: Import .bak to local SQL Express Server
Move the .bak File to SQL Server Backup Location: After downloading the .bak file, move it to the SQL Server backup location. This location can vary based on your SQL Server version and installation preferences. For a default instance of SQL Server 2019 (15.x), the default location is:
C:\Program Files\Microsoft SQL Server\MSSQL16.SQLEXPRESS\MSSQL\Backup
Connect to SQL Express via SSMS: Launch SQL Server Management Studio (SSMS) and connect to your SQL Express instance.
Restore the Database:
Right-click on 'Databases' in the Object Explorer.
Choose 'Restore Database...' from the dropdown menu.
In the upcoming wizard, select 'Device' and then click on the ellipses (...) to choose a backup device.
Hit 'Add' and navigate to the .bak file you moved earlier.
Once selected, click 'OK' to confirm your backup selection.
Navigate to the 'Files' tab and ensure the destination paths are set as desired.
Finally, click 'OK' to begin the database restoration process.
Step 4: Deploy Adventureworks2022 to Azure SQL
Connect to SQL Express via SSMS: If you're not already connected, open SSMS and establish a connection to your SQL Express instance.
Initiate Deployment:
Right-click on your restored AdventureWorks2022 database in the Object Explorer.
Navigate to 'Tasks'.
Choose 'Deploy Database to Microsoft Azure SQL Database...' from the dropdown menu.
Deploy to Azure SQL: The deployment wizard will guide you through the process of connecting to your Azure SQL Database instance and initiating the deployment.
Connect to your destination server and authenticate with the necessary credentials
Choose database name for the newly deployed database. Default is AdventureWorks2022and configurations set for your Azure environment.
Once you have provided the necessary Azure credentials and configurations you can click โFinishโ to start the deployment.
Once the deployment completes, you'll have the AdventureWorks2022 dataset available on your Azure SQL instance, ready for exploration and testing. Happy querying!