Disconnect your SQL Server instances from Azure Arc

Applies to: SQL Server

This article describes how you can disconnect the Arc-enabled SQL Server instances from Azure Arc using Azure portal or in the command shell.

Prerequisites

Your Azure account is in a Contributor role for the instance subscription and resource group.

Important

You don't need access to the hosting machine to disconnect from Azure Arc.

Opt out of automatic installation

Before you uninstall the Azure extension for SQL Server, opt out of the automatic installation of Azure extension for SQL Server, add the following tag and value to the Arc Server resource.

Tag Value
ArcSQLServerExtensionDeployment Disabled

Alternatively, you can limit which extensions can be installed on your server. You can configure lists of the extensions you wish to allow and block on the server. To learn more, see Extension allowlists and blocklists.

Uninstall Azure extension for SQL Server

To uninstall Azure extension for SQL Server:

  1. Go to Azure Arc portal
  2. Under Machines select the specific server that hosts the SQL Server instance
  3. Under Extensions, select the extension you want to uninstall (WindowsAgent.SqlServer if it's a Windows machine, or LinuxAgent.SqlServer if it's a Linux machine)
  4. Click on the Uninstall tab
  5. Confirm that you want to uninstall the extension when prompted

To remove the SQL Server - Azure Arc resources:

  1. Go to Azure Arc portal
  2. Under SQL Servers instances select the specific SQL Server instances you wish to remove
  3. Click on the Delete tab
  4. Confirm that you want to delete the resource when prompted

To disconnect all the Arc-enabled SQL Server instances in a larger scope, such as a resource group, subscription, or multiple subscriptions, with a single command, use the script to uninstall Azure Extension for SQL Server. The script is as an open source SQL Server sample and includes the step-by-step instructions.

Residual files and accounts

This section explains files and database objects left after you uninstall.

Files

Uninstalling deletes the binary files.

Extension logs and other data may not be deleted.

Disabling doesn't delete any binary files or folders.

Tables

Tables created by the agent stay after the extension is uninstalled.

Accounts

If you didn't install the extension in least privilege mode, the agent uses NTAUTHORITY\SYSTEM account.

Disabling or deleting the extension doesn't remove NTAUTHORITY\SYSTEM login from any databases because other applications may require this login. You have to manually remove the role from each user database.

NTAUTHORITY\SYSTEM account doesn't apply to installations with least privilege. For details about least privilege mode, see Operate SQL Server enabled by Azure Arc with least privilege (preview).