| title | Register with SQL Server IaaS Agent extension (Linux) | |
|---|---|---|
| description | Learn how to register your SQL Server on Linux Azure Virtual Machines with the SQL Server IaaS Agent extension to enable Azure features, compliance, and improved manageability. | |
| author | adbadram | |
| ms.author | adbadram | |
| ms.reviewer | mathoma, randolphwest | |
| ms.date | 03/05/2026 | |
| ms.service | azure-vm-sql-server | |
| ms.subservice | management | |
| ms.topic | how-to | |
| ms.custom |
|
|
| tags | azure-resource-manager |
[!INCLUDE appliesto-sqlvm]
[!div class="op_single_selector"]
Register your SQL Server VM with the SQL Server IaaS Agent extension to enable additional management features for your SQL Server on Linux Azure VM.
When you register with the extension, you create the SQL virtual machine resource within your subscription. This resource is separate from the virtual machine resource. When you unregister your SQL Server VM from the extension, you remove the SQL virtual machine resource but keep the actual virtual machine.
To use the extension, you must first register your subscription with the Microsoft.SqlVirtualMachine provider. This registration grants the extension the ability to create resources within that subscription.
Important
The SQL Server IaaS Agent extension collects data to provide customers with optional benefits when using SQL Server in Azure Virtual Machines. Microsoft doesn't use this data for licensing audits without your advance consent. To learn more, see the SQL Server privacy supplement.
To register your SQL Server VM with the extension, you need:
- An Azure subscription.
- A Linux virtual machine running SQL Server 2017 or a later version deployed in the public or Azure Government cloud.
- The latest version of Azure CLI or Azure PowerShell (5.0 minimum).
To register your SQL Server VM with the extension, first register your subscription with the Microsoft.SqlVirtualMachine resource provider. This registration grants the extension the ability to create resources within your subscription. You can register using the Azure portal, Azure CLI, or Azure PowerShell.
Register your subscription with the resource provider by using the Azure portal:
- Open the Azure portal and go to All Services.
- Go to Subscriptions and select the subscription you want to use.
- On the Subscriptions page, select Resource providers under Settings.
- Enter sql in the filter to bring up the SQL-related resource providers.
- Select Register, Re-register, or Unregister for the Microsoft.SqlVirtualMachine provider, depending on your desired action.
:::image type="content" source="../windows/media/sql-agent-extension-manually-register-single-vm/select-resource-provider-sql.png" alt-text="Screenshot of how to modify the provider." lightbox="../windows/media/sql-agent-extension-manually-register-single-vm/select-resource-provider-sql.png":::
Register your Azure subscription with the Microsoft.SqlVirtualMachine provider using either Azure CLI or Azure PowerShell.
Register your subscription with the resource provider by using Azure CLI:
az provider register --namespace Microsoft.SqlVirtualMachine
Register your subscription with the resource provider by using Azure PowerShell:
Register-AzResourceProvider -ProviderNamespace Microsoft.SqlVirtualMachine
The extension is only available in lightweight mode on Linux, which supports only changing the license type and edition of SQL Server. Use the Azure CLI or Azure PowerShell to register your SQL Server VM with the extension in lightweight mode for limited functionality.
Provide the SQL Server license type as either pay-as-you-go (PAYG) to pay per usage, Azure Hybrid Benefit (AHUB) to allocate your own license, or disaster recovery (DR) to activate the free DR replica license.
Register a SQL Server VM in lightweight mode with the Azure CLI:
# Register Enterprise or Standard self-installed VM in Lightweight mode
az sql vm create --name <vm_name> --resource-group <resource_group_name> --location <vm_location> --license-type <license_type>
Register a SQL Server VM in lightweight mode with Azure PowerShell:
-
Get the existing compute VM:
$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name> -
Register SQL VM with the extension:
New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Location $vm.Location ` -LicenseType <license_type>
You can verify if your SQL Server VM is registered with the extension by using the Azure portal, the Azure CLI, or Azure PowerShell.
Verify the registration status by using the Azure portal:
- Sign in to the Azure portal.
- Go to your SQL virtual machines resource.
- Select your SQL Server VM from the list. If your SQL Server VM isn't listed here, it likely isn't registered with the extension.
Verify current SQL Server VM registration status using either Azure CLI or Azure PowerShell. ProvisioningState shows as Succeeded if registration was successful.
Verify the registration status with Azure CLI:
az sql vm show -n <vm_name> -g <resource_group>
Verify the registration status with Azure PowerShell:
Get-AzSqlVM -Name <vm_name> -ResourceGroupName <resource_group>
An error indicates that the SQL Server VM isn't registered with the extension.
Automatic registration with the extension enables Azure to register all existing and future SQL Server VMs in a subscription with the extension, helping you maintain consistent management.