SQL Server 2022: Step-by-Step Guide to Connect your SQL Server to Azure Arc

When you install SQL Server 2022 through the GUI, you will see an option in the features “SQL Server Extention for Azure”

If you are selecting this option, be ready to have all the information shown below:

Failure to provide any of the below will throw below error:

I have seen the above error multiple times while I tried to enter the values. I believe that I provided the correct values but not sure if I was missing anything. I decided to install the SQL Server 2022 without including this extension from the GUI but instead install the Azure arc manually later. This blog post shows exactly the same. A step-by-step guide to install and configure connecting your on-prem SQL Server into Azure using Azure-arc.

You need to have an active subscription to install Azure Arc connection to your SQL Server. In the Azure portal search bar, select “Azure Arc SQL” and select SQL Server – Azure Arc from the list.

Click on add

Under Add existing SQL Server instances> Click on Connect Servers

Check all the prerequisites are in place

Provide the subscription, resource group name, Region, Operating system, Servername (Hostname of the server which will include all the instances including the default instance of SQL Server), License type

By default, all the instances will be included as you provide the machine name but if you would like to exclude any instances, you can provide the name of the instance separated by a comma.

I am not going to provide any tags here, click next to run the script

Observe this page properly. Copy the code.

In the second step, it shows “Run the above script on the machine you set up the prerequisites. Make sure the machine has network connectivity to Azure and to your target machine with SQL Server.

For Windows only: The PowerShell script you download will be unsigned. You can sign the PowerShell script or you can run the script by setting the PowerShell execution policy to allow running unsigned scripts.”

I used the execution policy for the current user to run the Powershell script. In PowerShell window, run the below script which will give the current user permission to execute the scripts.

Get-ExecutionPolicy -Scope CurrentUser

Now, Paste the code that you copied in the PowerShell and hit enter.

Azure extension for the SQL Server is installed. Check for the registered SQl Servers in Azure Arc.

Click on the instance to see more details about the server. I have clicked on my named instance>databases from the left side blade. You can see the list of databases

I would like to connect to Azure from SQL Server 2022 on-prem. To do that, you need to enable Azure Active Directory. In the next blog post, I will explain how we can set up the AAD (Azure Active Directory authentication) to SQL Server 2022 and connect from your local SQL Server management studio to Azure.

Thanks for reading!

2 thoughts on “SQL Server 2022: Step-by-Step Guide to Connect your SQL Server to Azure Arc

Leave a comment