Connect your SQL Server to Azure Arc

This article explains how to connect your SQL Server instance to Azure Arc. Before you proceed, complete the Prerequisites.

Onboard the server to Azure Arc

If the server that runs your SQL Server instance isn't yet connected to Azure, you can initiate the connection from the target machine using the onboarding script. This script connects the server to Azure and installs the Azure extension for SQL Server.

Note

If your server is already connected to Azure, proceed to When the machine is already connected to an Arc-enabled Server.

Generate an onboarding script for SQL Server

  1. Go to Azure Arc > SQL Server and select + Add

    Screenshot of the start creation.

  2. Under Connect SQL Server to Azure Arc, select Connect Servers

  3. Review the prerequisites and select Next: Server details

  4. Specify:

    • Subscription
    • Resource group
    • Region
    • Operating system

    If necessary, specify the proxy your network uses to connect to the Internet.

    To use a specific name for Azure Arc enabled Server instead of default host name, users can add the name for Azure Arc enabled Server in Server Name.

    Screenshot of server details for Azure Arc.

  5. Select the SQL Server edition and license type you are using on this machine. Please note that some Arc-enabled SQL Server features are only available for SQL Servers with Software Assurance (Paid) or with Azure pay-as-you-go. For more information, review Manage SQL Server license type.

  6. Specify the SQL Server instance(s) you want to exclude from registering (if you have multiple instances installed on the server). Separate each excluded instance by a space.

    Important

    If the machine hosting the SQL Server instance is already connected to Azure Arc, make sure to select the same resource group that contains the corresponding Server - Azure Arc resource.

    Screenshot of server management details.

  7. Select Next: Tags to optionally add tags to the resource for your SQL Server instance.

  8. Select Run script to generate the onboarding script. Screenshot of

    Screenshot of a download script.

  9. Select Download to download the script to your machine.

Connect SQL Server instances to Azure Arc

In this step, you'll take the script you downloaded from the Azure portal and execute it on the target machine. The script installs Azure extension for SQL Server. If the machine itself doesn't have the Azure connected machine agent installed, the script will install it first, then install the Azure extension for SQL Server. Azure connected machine agent will register the connected server as an Azure resource of type Server - Azure Arc, and Azure extension for SQL Server will connect the SQL Server instances as Azure resources of type SQL Server - Azure Arc.

Important

Make sure to execute the script using an account that meets the minimum permission requirements described in prerequisites.

  1. Launch an admin instance of powershell.exe and sign in to your PowerShell module with your Azure credentials. Follow the sign-in instructions.

  2. Execute the downloaded script.

    & '.\RegisterSqlServerArc.ps1'
    

    Note

    If you have yet to previously install the Az PowerShell module and see issues the first time you run it, follow the instructions in the script and rerun it.

Validate your Arc-enabled SQL Server resources

Go to Azure Arc > SQL Server and open the newly registered Arc-enabled SQL Server resource to validate.

Screenshot of validating a connected SQL server.

Next steps