Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only and Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not responsible for the contents of any linked site or any link contained in a linked site, or any changes or updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission received from any linked site. Microsoft is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement of Microsoft of the site or the products contained therein.
© 2023 Microsoft Corporation. All rights reserved.
Microsoft and the trademarks listed at https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/Usage/General.aspx are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.
Contents
- Building the business migration case with Windows Server and SQL Server hands-on lab step-by-step
In this hands-on lab, you will perform steps to migrate Windows Server and SQL Server workloads to Azure. You will go through provisioning a Windows Server VM, migrating a SQL Server database to Azure SQL Managed Instance (SQL MI), and Azure Arc-enable an on-premises Windows Server VM.
In this lab, attendees will perform steps toward migrating Tailspin Toy's on-premises Windows Server and SQL Server workloads to Azure. Tailspin needs a new Windows Server VM created in Azure for hosting their Web application, an on-premises SQL Server database migrated to Azure SQL Managed Instance, and an on-premises Windows Server VM to be Azure Arc-enabled.
Tailspin already has a Hub and Spoke network setup in Azure with Azure Bastion for enabling remote management of Azure VM using Azure Bastion. The Azure resources provisioned throughout this lab will be deployed into this environment.
At the end of this hands-on lab, you will be better able to set up a Windows Server for application migration to Azure, migrate an on-premises SQL Database to Azure SQL Managed Instance, and Azure Arc-enable an on-premises virtual machine so it can be managed from Azure.
The diagram shows an on-premises network connected to Azure using Azure ExpressRoute with a Hub and Spoke network in Azure. The Spoke VNet contains the migrated Front-end, Back-end, and SQL Database workloads running within Subnets inside the Spoke VNet in Azure.
- You must have a working Azure subscription to carry out this hands-on lab step-by-step without a spending cap to deploy the Barracuda firewall from the Azure Marketplace.
Refer to the Before the hands-on lab setup guide manual before continuing to the lab exercises.
Duration: 75 minutes
Tailspin Toys need to migrate their on-premises SQL Server database to Azure SQL Managed Instance. This is part of the migration strategy defined to migrate Tailspin Toys workloads to Azure.
In this exercise, you will go through the steps necessary to migrate Tailspin Toys' on-premises SQL Server database to Azure SQL Managed Instance.
Note: Since Azure SQL Manage Instance can take up to 4 hours to provision, the ARM Template deployment in the Before the Hands-on Lab deployment has already created the Azure SQL Managed Instance resource for this lab.
-
In the Azure Portal, navigate to the Resource Group for the lab, then navigate to the
tailspin-onprem-sql-vm
virtual machine. This is the simulated on-premises SQL Server VM that contains the database to migrate to Azure SQL MI. -
On the left, select Bastion under Operations.
-
Enter the Username and Password, then select Connect.
Note: When the VM was created the credentials were set up as:
- Username:
demouser
- Password:
demo!pass123
- Username:
-
In the tailspin-onprem-sql-vm virtual machine, go to Server Manager, and select Local Server.
-
Within Local Server, select the
On
text link for the IE Enhanced Security Configuration property. -
On the Internet Explorer Enhanced Security Configuration dialog, select Off for Administrators, then select OK.
-
In the tailspin-onprem-sql-vm virtual machine, open Internet Explorer then go to the following link and download the .NET Framework 4.8 Runtime installer. This will be needed to install the Microsoft Data Migration Assistant.
https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net48-web-installer
-
Select Run to run the .NET Framework 4.8 Runtime installer once it's finished downloading and follow the prompts to install the .NET Framework.
-
Using Internet Explorer, go to the following link and download the Microsoft Data Migration Assistant.
-
Select Run to run the Microsoft Data Migration Assistant installer once it's finished downloading and follow the prompts to install the assistant.
-
Run the Microsoft Data Migration Assistant previously installed.
-
On the left, select the Plus sign (
+
) button to create a new project, and enter the following values, then select Create.- Project type: Assessment
- Project name: Tailspin
- Assessment type: Database Engine
- Source server type: SQL Server
- Target server type: Azure SQL Database Managed Instance
-
On the Options tab, ensure the Check database compatibility and Check feature parity report types are selected, then select Next.
-
On the Connect to a server prompt, enter
localhost
for the Server name, and check the Trust server certificate option, then select Connect. -
On the Add sources prompt, select the WideWorldImporters database, then select Add.
-
Select Start Assessment in the lower right.
-
On the Review results pane, you should see a message that states, "There are no feature parity issues with your server instance."
-
On the top left of the Review results pane, select Compatibility issues.
-
On the Review results pane, you should see a message that "There are no compatibility issues with your database".
-
The Data Migration Assessment is complete. If there were feature parity or compatibility issues found, then you would need to address those before migrating the SQL Server database to Azure SQL MI.
-
In the tailspin-onprem-sql-vm virtual machine, open the Start menu, then type Azure Data Studio to search the application, then select it to run Azure Data Studio.
-
On the Azure Data Studio menu, select the Help menu, then select the Check for updates... option. Wait a few seconds, and a notification will appear on the lower right corner of Azure Data Studio. Select Update Now to run the Azure Data Studio installer. Once it's finished it should load Azure Data Studio again.
-
On the left, select the Extensions tab, then select the Azure SQL Migration extension and install it.
-
Next, you need to enable Preview Features within Azure Data Studio. Select the Manage icon (shown as the Gear in the lower left corner of Azure Data Studio) and select Settings.
-
On the Settings pane, type Enable Preview Features in the search box at the top, then check the Enable unreleased preview features box for the Workbench: Enable Preview Features option that shows in the search results. This will autosave.
-
Next, let's connect to the on-premises SQL Server. Select the Connections tab on the left side of Azure Data Studio, then select New Connection.
-
On the Connection pane, enter the following values to connect to the on-premises SQL database, then select Connect:
- Connection type: Microsoft SQL Server
- Server:
localhost
- Authentication type: Windows Authentication
- Database:
WideWorldImporters
-
In the list of servers, right-click the localhost, WideWorldImporters server, then select Manage.
-
Select Backup.
-
On the Backup database pane, make sure the Backup type is set to Full, select the Reliability option to Perform checksum before writing to media, then make a note of the location of the Backup files, and select Backup.
-
Open Internet Explorer, navigate to the following URL, download Microsoft Azure Storage Explorer, and install it.
-
Launch Microsoft Azure Storage Explorer.
-
Select Sign in with Azure.
-
Sign in with your Microsoft Account.
-
In the Explorer pane, expand the Azure Subscription, locate the previously created Storage Account (named similar to
tailspinsqlmistorage
), then expand Blob Container and select the sql-backup container. -
In the sql-backup container pane, select Upload, then select Upload Files....
-
In the Upload Files dialog, in the Selected files field, select the Database Backup File (
.bak
) for the WideWorldImporters database you created earlier, then select Upload.
-
Within Azure Data Studio, under the list of servers, right-click the localhost, WideWorldImporters server, then select Manage.
-
Select the Azure SQL Migration option.
-
Select the Migrate to Azure SQL button.
-
In Step 1: Database for assessment, select the WideWorldImporters database, then select Next.
-
In Step 2: Assessment results and recommendations, select the Azure SQL Managed Instance option.
-
Scroll down and select the View/Select button to select a database.
-
Select the WideWorldImporters database, and you should see a message stating, "
No issues for migrating to Azure SQL Managed Instance.
", then select the Select button. -
Verify the Azure SQL Managed Instance target is selected, notice that it now shows 1 of 1 databases selected, then select Next.
-
In Step 3: Azure SQL target, enter connection information to your Azure Subscription and for the Azure SQL Manage Instance resource you created (named similar to
tailspin-sqlmi
), then select Next. -
On Step 4: Azure Database Migration Service, keep Online migration selected. Select Next.
-
In Select the location of the database backups to use during migration, select My database backups are in an Azure Storage Blob Container.
-
Select Create new under Azure Database Migration Service.
-
In the Create Azure Database Migration Service pane, enter the following values, then select Create.
- Resource group: Select the Resource Group for this lab, for example:
tailspin-rg
. - Name:
tailspin-sql-migration
- Resource group: Select the Resource Group for this lab, for example:
-
Once the Database Migration Service has been created, select Done.
-
Select the Azure Database Migration Service that was created, then select Next.
-
In Step 5: Data source configuration, select the Azure Storage Account and container created previously, then select Next.
-
In Step 6: Summary, review all the configurations chosen, then select Start migration.
-
Azure Data Studio will now show Database migrations in progress - 1.
-
In the Azure Portal, navigate to the Azure Database Migration Service (named similar to
tailspin-sql-migration
), then select Migrations and the WideWorldImporters migration. -
The WideWorldImporters migration shows the current status of the migration as
InProgress
. Notice the Currently restoring files should say All backups restored once the database backup has been restored. Then select Complete cutover at the top. -
In the Complete cutover prompt, select the box for I confirm there are no additional log backups..., then select Complete cutover.
-
The WideWorldImporters Migration will now show the status of Completing. This will take a few minutes to complete.
-
Once the cutover has been completed, the WideWorldImporters migration will show a status of Succeeded.
-
Within the Azure Portal, navigate to the Azure SQL Managed Instance created previously.
-
When the SQL Server database migration to Azure SQL MI has completed, you will see the WideWorldImporters database shown with an Online status.
Duration: 30 minutes
In this exercise, you will create a new Windows Server 2022: Azure Edition virtual machine (VM) that will be the destination for migrating the on-premises Web Application to Azure, and then you will use Azure Bastion to connect to the VM over Remote Desktop (RDP). Azure Bastion will allow secure remote connections to the VM for Administrators. Windows Server Azure Edition is a specific image of Windows Server with unique capabilities such as rebootless patching with Hotpatch, available only on Azure.
In this task, you will create a new Windows Server 2022: Azure Edition virtual machine (VM) that will be the destination for migrating the on-premises Web Application to Azure.
-
Sign in to the Azure Portal. Ensure that you're using a subscription associated with the same resources you created during the Before the hands-on lab set up.
-
On the Home page within the Azure Portal, towards the top, select Create a resource.
-
Within the Search services and marketplace field, type Windows Server and press Enter to search the marketplace, then select Windows Server.
-
Choose Windows Server 2022 Datacenter: Azure Edition, then select Create.
-
On the Create a virtual machine pane, set the following values to configure the new virtual machine:
- Resource group: Select the resource group that you created for this lab. Such as
tailspin-rg
. - Virtual machine name: Give the VM a unique name, such as
tailspin-webapp-vm
. - Region: Select North Central US
- Image: Verify the image is set to Windows Server 2022 Datacenter: Azure Edition - Gen 2.
- Resource group: Select the resource group that you created for this lab. Such as
-
Set the Size field by selecting the Standard_D4s_v5 virtual machine size.
-
Set a Username and Password for the Administrator account for the VM.
Note: Be sure to save the Username and Password for the VM, so it can be used later. A recommendation for easy to remember Username is
demouser
and Password isdemo!pass123
. -
Select Next until you are navigated to the Networking tab of the Create a virtual machine page.
-
Provision the VM in the Spoke VNet in Azure by selecting the following values under the Network interface section:
- Virtual network: Select the Spoke VNet created for this lab. Its name will be similar to
tailspin-spoke-vnet
. - Subnet:
default
- Public IP:
None
- Virtual network: Select the Spoke VNet created for this lab. Its name will be similar to
-
Set the following values to ensure that HTTPS traffic will be allowed to connect to the VM:
- Public inbound ports:
Allow selected ports
- Select inbound ports:
HTTPS (443)
- Public inbound ports:
-
Select Review + create to review the virtual machine settings.
-
Select Create to begin provisioning the virtual machine once the Validation passed message is shown.
In this task, you will test Remote Desktop (RDP) connectivity to the newly created virtual machine using Azure Bastion.
-
In the Azure Portal, navigate to the newly created Virtual Machine.
-
On the left, under the Operations section, select Bastion.
-
On the Bastion pane, enter the Username and Password that was set for the Administrator User of the VM when it was created, then select Connect.
Note: The Azure Bastion instance named
tailspin-hub-bastion
was previously created with the Before the Hands-on lab setup. This is a required resource for using Azure Bastion to securely connect to Azure VMs using RDP from within the Azure Portal. -
A new browser tab will open with Azure Bastion connected to the virtual machine over RDP. To close this session, you can close this browser tab.
Note: Now that the Windows Server 2022 VM has been created in Azure, Tailspin Toys will now be able to modify their Continuous Integration and Continuous Deployment (CI/CD) pipelines within Azure DevOps to begin deploying the Web Application code to this virtual machine as they get ready for migrating the application to Azure.
Duration: 45 minutes
In this exercise, you will Azure Arc-enable a Windows Server VM that Tailspin has on-premises. This VM is being Arc-enabled since there are no plans to migrate it to Azure, but Tailspin would like to simplify the management of all their VMs in a single place. Azure Arc provides the functionality to manage Azure and on-premises VMs in a single place giving Tailspin Toys exactly what they are looking for to simplify VM management and administration.
-
Sign in to the Azure Portal. Ensure that you're using a subscription associated with the same resources you created during the Before the hands-on lab set up.
-
In the Search resources, services, and docs box at the top of the portal, search for Azure Arc, then select the Azure Arc service.
-
On the Azure Arc pane, select the Infrastructure tab, then select the Add button under Servers.
-
Under Add a single server select Generate script.
-
On the Add a server with Azure Arc pane, read the requirements of Azure Arc that are listed, then select Next.
-
On the Resource details tab, enter the following values, then select Next.
- Resource group: Select the Resource Group created for this lab. For example:
tailspin-rg
. - Region: Select North Central US.
- Operating system:
Windows
- Connectivity method:
Public endpoint
- Resource group: Select the Resource Group created for this lab. For example:
-
On the Tags tab, enter the following tag values to identify this server, then select Next:
- Datacenter:
headquarters
- City:
Milwaukee
- StateOrDistrict:
WI
- CountryOrRegion:
USA
- Datacenter:
-
On the Download and run script tab, select Download to download the generated script. By default, the script named
OnboardingScript.ps1
will be saved to theDownloads
folder.
-
In the Azure Portal, navigate to the Resource Group for the lab, then select the
tailspin-onprem-hyperv-vm
virtual machine resource. This is the simulated on-premises Hyper-V host VM. -
On the left, select Bastion under Operations.
-
Enter the Username and Password, then select Connect.
Note: When the VM was created the credentials were set up as:
- Username:
demouser
- Password:
demo!pass123
- Username:
-
Once connected to the Hyper-V Host VM, open the Start menu, then search for and run the Hyper-V Manager.
-
Within the Hyper-V Manager, double-click the OnPremVM VM to connect to it.
-
Once connected to the OnPremVM VM within Hyper-V, sign in using the Administrator account and the password of
demo!pass123
.Note: If you encounter that the OnPremVM has No Internet Connection, go back into the
tailspin-onprem-hyperv-vm
Hyper-V Host VM and perform the following steps:- Open the Network Connections.
- Locate the Ethernet connection and right-click it.
- Select Properties.
- Select the Sharing tab.
- Disable and re-enable Internet Connection Sharing on this connection.
You may see a warning message when disabling it and re-enabling it, but it will still work to restore Internet Connection Sharing with the OnPremVM that is connected through the Host VM's network connection.
-
Within the OnPremVM, open Internet Explorer, go to the following link to download the Windows Update for installing PowerShell 5.1, and run it. This will install PowerShell 5.1 on the Windows Server 2012 R2 VM, since this is the version of PowerShell required by the Azure Arc script.
-
Within the OnPremVM, open Internet Explorer, go to the following link to download the .NET Framework 4.8, and install it. The Azure Arc script will install the Azure Connected Machine Agent which requires .NET Framework 4.6 or later.
https://go.microsoft.com/fwlink/?LinkId=2085155
Note: The .NET Framework installer will display a Blocking Issues box with a note that another update needs to be installed. The following 2 updates will need to be installed in the following order:
- Install KB2919442 from https://www.microsoft.com/en-us/download/details.aspx?id=42153
- Install KB2919355 from https://www.microsoft.com/en-us/download/details.aspx?id=42334
Be sure to restart the VM after installing the updates and before you continue with the .NET Framework install.
-
Within the OnPremVM, open the Windows PowerShell ISE, and create a new script file.
-
Paste in the contents of the Azure Arc
OnboardingScript.ps1
script previously downloaded.Note: Within the Hyper-V Virtual Machine Connection window, you may need to use the Clipboard -> Type clipboard text menu option to paste into the OnPremVM.
-
Run the full script. This will install the Azure Arc agent and Arc-enable the VM. When the script opens a browser window, enter your credentials to authenticate with Azure.
Note: When the Azure Arc script opens a new browser window to authenticate you with Azure, be sure to use an Organization Account with permissions to create
Microsoft.HybridCompute/machines
resources. Using a Personal Account is not supported and will result in aAZCM0042: Failed to Create Resource
error message. -
When the script finishes executing successfully, a message stating "Connected machine to Azure" will be shown, along with the Azure Portal resource URL for the Azure Arc-enabled Server.
-
In the Azure Portal, navigate to the Resource Group for the lab.
-
Scroll down and locate the Azure resource of type Server - Azure Arc. and select it.
Note: The on-premises VM has been Azure Arc-enabled and can be managed alongside other Azure resources. This is enabled by the Azure Connected Machine Agent running on the VM that facilitates the interaction between Azure and the Azure Arc-enabled VM.
-
This is the Server - Azure Arc pane for the on-premises virtual machine that was just Azure Arc-enabled. The Status shows Connected to signify that the Azure Arc-enabled virtual machine is connected to Azure. Also, notice that the Computer Name and Operating System of the virtual machine are displayed.
-
From here, there are several Azure Arc capabilities available to use for managing the Azure Arc-enabled virtual machine.
-
Select Extensions under Settings. This is where you can install Extensions on the Azure Arc-enabled virtual machine. For example, the Custom Script Extension for Windows - Azure Arc extension can be used to download PowerShell scripts and files from Azure storage and launch a PowerShell script on the machine.
Duration: 15 minutes
-
Go to the Azure Portal.
-
Go to your Resource groups.
-
Select the Resource group you created.
-
Select Delete Resource group.
-
Enter the name of the Resource group and select Delete.
You should follow all steps provided after attending the Hands-on lab.