Skip to content

Latest commit

 

History

History
160 lines (102 loc) · 7.26 KB

sql-iaas-agent-extension-register-vm-linux.md

File metadata and controls

160 lines (102 loc) · 7.26 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic ms.custom tags
Register with SQL IaaS Agent extension (Linux)
Learn how to register your SQL Server on Linux Azure VM with the SQL IaaS Agent extension to enable Azure features, as well as for compliance, and improved manageability.
adbadram
adbadram
mathoma
10/26/2021
virtual-machines-sql
management
how-to
devx-track-azurecli, devx-track-azurepowershell, linux-related-content
azure-resource-manager

Register Linux SQL Server VM with SQL IaaS Agent extension

[!INCLUDEappliesto-sqlvm]

[!div class="op_single_selector"]

Register your SQL Server VM with the SQL IaaS Agent extension to unlock a wealth of feature benefits for your SQL Server on Linux Azure VM.

Overview

Registering with the SQL Server IaaS Agent extension creates the SQL virtual machine resource within your subscription, which is a separate resource from the virtual machine resource. Unregistering your SQL Server VM from the extension removes the SQL virtual machine resource but will not drop the actual virtual machine.

To utilize the SQL IaaS Agent extension, you must first register your subscription with the Microsoft.SqlVirtualMachine provider, which gives the SQL IaaS Agent extension the ability to create resources within that specific subscription.

Important

The SQL IaaS Agent extension collects data for the express purpose of giving customers optional benefits when using SQL Server within Azure Virtual Machines. Microsoft will not use this data for licensing audits without the customer's advance consent. See the SQL Server privacy supplement for more information.

Prerequisites

To register your SQL Server VM with the extension, you'll need:

Register subscription with RP

To register your SQL Server VM with the SQL IaaS Agent extension, you must first register your subscription with the Microsoft.SqlVirtualMachine resource provider (RP). This gives the SQL IaaS Agent extension the ability to create resources within your subscription. You can do so by using the Azure portal, the Azure CLI, or Azure PowerShell.

Azure portal

Register your subscription with the resource provider by using the Azure portal:

  1. Open the Azure portal and go to All Services.
  2. Go to Subscriptions and select the subscription of interest.
  3. On the Subscriptions page, select Resource providers under Settings.
  4. Enter sql in the filter to bring up the SQL-related resource providers.
  5. Select Register, Re-register, or Unregister for the Microsoft.SqlVirtualMachine provider, depending on your desired action.

Modify the provider

Command line

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 the Azure CLI:

# Register the SQL IaaS Agent extension to your subscription 
az provider register --namespace Microsoft.SqlVirtualMachine 

Register your subscription with the resource provider by using Azure PowerShell:

# Register the SQL IaaS Agent extension to your subscription
Register-AzResourceProvider -ProviderNamespace Microsoft.SqlVirtualMachine

Register VM

The SQL IaaS Agent extension on Linux is only available in lightweight mode, 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 use 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 SQL IaaS Agent extension
New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Location $vm.Location `
  -LicenseType <license_type> 

Verify registration status

You can verify if your SQL Server VM has already been registered with the SQL IaaS Agent extension by using the Azure portal, the Azure CLI, or Azure PowerShell.

Azure portal

Verify the registration status by using the Azure portal:

  1. Sign in to the Azure portal.
  2. Go to your SQL virtual machines resource.
  3. Select your SQL Server VM from the list. If your SQL Server VM is not listed here, it likely hasn't been registered with the SQL IaaS Agent extension.

Command line

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 by using the Azure CLI:

az sql vm show -n <vm_name> -g <resource_group>

Verify the registration status by using the Azure PowerShell:

Get-AzSqlVM -Name <vm_name> -ResourceGroupName <resource_group>

An error indicates that the SQL Server VM has not been registered with the extension.

Automatic registration

Automatic registration is supported for Ubuntu Linux VMs.

Next steps

For more information, see the following articles: