|
| 1 | +--- |
| 2 | +title: Register with SQL IaaS Agent extension (Linux) |
| 3 | +description: 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. |
| 4 | +services: virtual-machines-windows |
| 5 | +documentationcenter: na |
| 6 | +author: adbadram |
| 7 | +tags: azure-resource-manager |
| 8 | +ms.service: virtual-machines-sql |
| 9 | +ms.subservice: management |
| 10 | +ms.devlang: na |
| 11 | +ms.topic: how-to |
| 12 | +ms.tgt_pltfrm: vm-Linux-sql-server |
| 13 | +ms.workload: iaas-sql-server |
| 14 | +ms.date: 10/26/2021 |
| 15 | +ms.author: adbadram |
| 16 | +ms.reviewer: mathoma |
| 17 | +ms.custom: devx-track-azurecli, devx-track-azurepowershell, contperf-fy21q2 |
| 18 | + |
| 19 | +--- |
| 20 | +# Register Linux SQL Server VM with SQL IaaS Agent extension |
| 21 | +[!INCLUDE[appliesto-sqlvm](../../includes/appliesto-sqlvm.md)] |
| 22 | + |
| 23 | +> [!div class="op_single_selector"] |
| 24 | +> * [Windows](../windows/sql-agent-extension-manually-register-single-vm.md) |
| 25 | +> * [Linux](sql-iaas-agent-extension-register-vm-linux.md) |
| 26 | +
|
| 27 | + |
| 28 | +Register your SQL Server VM with the [SQL IaaS Agent extension](sql-server-iaas-agent-extension-linux.md) to unlock a wealth of feature benefits for your SQL Server on Linux Azure VM. |
| 29 | + |
| 30 | +## Overview |
| 31 | + |
| 32 | +Registering with the [SQL Server IaaS Agent extension](sql-server-iaas-agent-extension-linux.md) 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. |
| 33 | + |
| 34 | +To utilize the SQL IaaS Agent extension, you must first [register your subscription with the **Microsoft.SqlVirtualMachine** provider](#register-subscription-with-rp), which gives the SQL IaaS extension the ability to create resources within that specific subscription. |
| 35 | + |
| 36 | +> [!IMPORTANT] |
| 37 | +> 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](/sql/sql-server/sql-server-privacy#non-personal-data) for more information. |
| 38 | +
|
| 39 | +## Prerequisites |
| 40 | + |
| 41 | +To register your SQL Server VM with the extension, you'll need: |
| 42 | + |
| 43 | +- An [Azure subscription](https://azure.microsoft.com/free/). |
| 44 | +- An Azure Resource Model [Ubuntu Linux virtual machine](../../../virtual-machines/linux/quick-create-portal.md) with [SQL Server 2017 (or greater)](https://www.microsoft.com/sql-server/sql-server-downloads) deployed to the public or Azure Government cloud. |
| 45 | +- The latest version of [Azure CLI](/cli/azure/install-azure-cli) or [Azure PowerShell (5.0 minimum)](/powershell/azure/install-az-ps). |
| 46 | + |
| 47 | +## Register subscription with RP |
| 48 | + |
| 49 | +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. |
| 50 | + |
| 51 | +### Azure portal |
| 52 | + |
| 53 | +Register your subscription with the resource provider by using the Azure portal: |
| 54 | + |
| 55 | +1. Open the Azure portal and go to **All Services**. |
| 56 | +1. Go to **Subscriptions** and select the subscription of interest. |
| 57 | +1. On the **Subscriptions** page, select **Resource providers** under **Settings**. |
| 58 | +1. Enter **sql** in the filter to bring up the SQL-related resource providers. |
| 59 | +1. Select **Register**, **Re-register**, or **Unregister** for the **Microsoft.SqlVirtualMachine** provider, depending on your desired action. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +### Command line |
| 65 | + |
| 66 | +Register your Azure subscription with the **Microsoft.SqlVirtualMachine** provider using either Azure CLI or Azure PowerShell. |
| 67 | + |
| 68 | +# [Azure CLI](#tab/bash) |
| 69 | + |
| 70 | +Register your subscription with the resource provider by using the Azure CLI: |
| 71 | + |
| 72 | +```azurecli-interactive |
| 73 | +# Register the SQL IaaS Agent extension to your subscription |
| 74 | +az provider register --namespace Microsoft.SqlVirtualMachine |
| 75 | +``` |
| 76 | + |
| 77 | +# [Azure PowerShell](#tab/powershell) |
| 78 | + |
| 79 | +Register your subscription with the resource provider by using Azure PowerShell: |
| 80 | + |
| 81 | +```powershell-interactive |
| 82 | +# Register the SQL IaaS Agent extension to your subscription |
| 83 | +Register-AzResourceProvider -ProviderNamespace Microsoft.SqlVirtualMachine |
| 84 | +``` |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Register VM |
| 89 | + |
| 90 | +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. |
| 91 | + |
| 92 | +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](../windows/business-continuity-high-availability-disaster-recovery-hadr-overview.md#free-dr-replica-in-azure). |
| 93 | + |
| 94 | +# [Azure CLI](#tab/bash) |
| 95 | + |
| 96 | +Register a SQL Server VM in lightweight mode with the Azure CLI: |
| 97 | + |
| 98 | +```azurecli-interactive |
| 99 | +# Register Enterprise or Standard self-installed VM in Lightweight mode |
| 100 | +az sql vm create --name <vm_name> --resource-group <resource_group_name> --location <vm_location> --license-type <license_type> |
| 101 | +``` |
| 102 | + |
| 103 | +# [Azure PowerShell](#tab/powershell) |
| 104 | + |
| 105 | +Register a SQL Server VM in lightweight mode with Azure PowerShell: |
| 106 | + |
| 107 | +```powershell-interactive |
| 108 | +# Get the existing compute VM |
| 109 | +$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name> |
| 110 | +# Register SQL VM with 'Lightweight' SQL IaaS agent |
| 111 | +New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Location $vm.Location ` |
| 112 | + -LicenseType <license_type> -SqlManagementType LightWeight |
| 113 | +``` |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## Verify registration status |
| 118 | + |
| 119 | +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. |
| 120 | + |
| 121 | + |
| 122 | +### Azure portal |
| 123 | + |
| 124 | +Verify the registration status by using the Azure portal: |
| 125 | + |
| 126 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 127 | +1. Go to your SQL virtual machines resource. |
| 128 | +1. 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. |
| 129 | + |
| 130 | +### Command line |
| 131 | + |
| 132 | +Verify current SQL Server VM registration status using either Azure CLI or Azure PowerShell. `ProvisioningState` shows as `Succeeded` if registration was successful. |
| 133 | + |
| 134 | +# [Azure CLI](#tab/bash) |
| 135 | + |
| 136 | +Verify the registration status by using the Azure CLI: |
| 137 | + |
| 138 | +```azurecli-interactive |
| 139 | +az sql vm show -n <vm_name> -g <resource_group> |
| 140 | +``` |
| 141 | + |
| 142 | +# [Azure PowerShell](#tab/powershell) |
| 143 | + |
| 144 | +Verify the registration status by using the Azure PowerShell: |
| 145 | + |
| 146 | +```powershell-interactive |
| 147 | +Get-AzSqlVM -Name <vm_name> -ResourceGroupName <resource_group> |
| 148 | +``` |
| 149 | + |
| 150 | +--- |
| 151 | + |
| 152 | +An error indicates that the SQL Server VM has not been registered with the extension. |
| 153 | + |
| 154 | + |
| 155 | +## Next steps |
| 156 | + |
| 157 | +For more information, see the following articles: |
| 158 | + |
| 159 | +* [Overview of SQL Server on a Windows VM](sql-server-on-linux-vm-what-is-iaas-overview.md) |
| 160 | +* [FAQ for SQL Server on a Windows VM](frequently-asked-questions-faq.yml) |
| 161 | +* [Pricing guidance for SQL Server on a Windows VM](../windows/pricing-guidance.md) |
| 162 | +* [Release notes for SQL Server on a Windows VM](../windows/doc-changes-updates-release-notes.md) |
0 commit comments