Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 01 - Azure Arc-enable SQL Server

Introduction

Tailspin Toys is beginning the migration of its SQL Server workloads to Azure. To support hybrid replication and failover with MI‑Link, the company first needs to connect its on‑premises SQL Server VM to Azure using Azure Arc. By Arc‑enabling the VM, Tailspin can extend Azure management capabilities to its existing environment and prepare for seamless database migration to Azure SQL Managed Instance.

Description

In this task, you will Arc‑enable the simulated on‑premises SQL Server VM using a PowerShell scripted generated in the Azure portal. Azure Arc provides a bridge between on‑premises infrastructure and Azure services, allowing Tailspin Toys to manage, secure, and migrate workloads consistently. Once enabled, the SQL Server instance can participate in MI‑Link replication, enabling hybrid migration and high availability/disaster recovery scenarios.

The key tasks are as follows:

  1. Log in to the tailspin<uniqueid>-onprem-sql-vm Virtual machine using Azure Bastion. This VM represents the Tailspin’s on-premises SQL Server environment.
  2. Install and configure Azure Arc on the VM to register it with Azure.
  3. Install the Azure extension for SQL Server to connect the SQL Server to Arc.

Success Criteria

  • You have successfully connected to the SQL Server VM via Azure Bastion.
  • The SQL Server is Arc‑enabled and visible in the Azure portal under Azure Arc SQL servers.
  • The SQL Server instance is ready to be linked with Azure SQL Managed Instance using MI‑Link in the next task.

Solution

Expand this section to view the solution
  1. In the Azure Portal, navigate to your lab resource group and select the tailspin<uniqueid>-onprem-sql-vm virtual machine from the list of resources.

    The Virtual machine pane for the Simulated on-premises SQL Server VM is shown in the Azure Portal.

    IMPORTANT: In this lab, the “on‑premises” SQL Server VM is simulated using the guidance for evaluating Azure Arc-enabled servers on an Azure virtual machine. This configuration is intended only for demo and testing purposes and should not be used in a production environment.

  2. On the VM blade, select Bastion under Connect in the left menu, and on the Bastion blade, enter the following username and password, ensure Open in a new browser window is checked, then select Connect.

    • Username: demouser
    • Password: demo!pass123

    IMPORTANT: When connecting via Bastion, you must ensure your browser permits pop-ups to allow the Bastion session to open in a new tab.

    The Bastion pane of the tailspin-onprem-sql-vm Virtual machine is shown with the Username and Password fields entered and highlighted.

  3. If prompted to allow the browser to “see text and images copied to the clipboard,” select Allow.

    The allow button in the see text and images copied to the clipboard dialog is highlighted.

  4. Once logged in to the SQL VM, open a web browser and navigate to the Azure portal.

  5. In the Azure portal, enter “azure arc” into the search bar, and select Azure Arc under Services in the results.

    The text "azure arc" is entered in the search box, and Azure Arc is highlighted under Services in the results.

  6. On the Azure Arc blade, select SQL servers under Data services in the left menu, then select Add on the toolbar.

    SQL servers is highlighted under Data services in the left menu of the Arc blade, and Add is highlighted on the toolbar.

  7. On the Add existing SQL Server instances page, select Connect SQL Server instances in the Connect SQL Server instances to Azure Arc tile to create a new registration.

    Connect SQL Server instances is highlighted within the *Connect SQL Server instances to Azure Arc tile.

  8. After reviewing the Prerequistes, select Next: Server details.

  9. On the Server details tab, enter the following:

    • Subscription: Select your subscription
    • Resource group: Select the resource group you created for this lab
    • Region: Select the region associated with your resource group
    • Operating system: Choose Windows
    • Server Name: Enter TailspinSql
    • License type: Select I want to license my production environment on this server with Enterprise or Standard edition pay-as-you-go ("PAYGO")
    • Select Next: Tags

    The Server details tab is populated with the values specified above.

  10. On the Tags tab, select Next: Run script.

  11. On the Run script tab, select Download. Alternatively, you can select the Copy to clipboard link, then paste the script into a file named RegisterSqlServerArc.ps1 that you save to the SQL VM.

    The Download button is highlighted on the Connect SQL Server enabled by Azure Arc page.

  12. On the SQL VM, open PowerShell as an administrator.

    PowerShell is entered into the Windows search bar, Windows PowerShell is selected in the results, and Run as administrator is highlighted in the context menu.

  13. At the PowerShell prompt, change directories to the location where you saved the downloaded file.

    NOTE: You can simplify the commands by copying the downloaded file to C:\scripts or a similarly short path.

  14. Run the following command:

    .\RegisterSqlServerArc.ps1
    

    IMPORTANT: If you receive the error, ‘Cannot install Azure Connected Machine agent on an Azure Virtual Machine. Azure Connected Machine Agent is designed for use outside Azure,’ execute the steps in PowerShell found in the step-by-step guide to enable Azure Arc on an Azure VM to prepare your VM.

  15. When prompted, navigate to https://microsoft.com/devicelogin, enter the code provided in the PowerShell window, and follow the prompts to log into your Azure account.

    The authentication URL and code are highlighted in the PowerShell dialog.

  16. The script will take 5-10 minutes to complete. It onboards SQL Server by installing the Azure Connected Machine Agent and the Azure Extension for SQL Server, and registering the machine with Azure Arc. When the script completes, verify you see the successful installation message.

    The success message is highlighted in the command output.

  17. Return to the Azure Arc SQL servers page in the Azure portal, select Refresh, and verify the TailspinSql SQL server appears in the list.

    SQL Servers is highlighted under Data services on the Azure Arc page, the Refresh button is highlighted, and the TailspinSql server is highlighted in the list of SQL Servers.

  18. You have successfully onboarded your SQL Server to Azure Arc.