SQL Server IaaS Agent extension in Azure Portal

The SQL Server IaaS Agent extension (SqlIaasExtension) runs on SQL Server on Azure Virtual Machines (VMs) to automate management and administration tasks.

Azure-SQL-Agent-1

The SQL Server IaaS Agent extension allows for integration with the Azure portal, and depending on the management mode, unlocks a number of feature benefits for SQL Server on Azure VMs:

  • Feature benefits: The extension unlocks a number of automation feature benefits, such as portal management, license flexibility, automated backup, automated patching and more.
  • Compliance: The extension offers a simplified method of fulfilling the requirement to notify Microsoft that the Azure Hybrid Benefit has been enabled as is specified in the product terms. This process negates needing to manage licensing registration forms for each resource.
  • Free: The extension in all three manageability modes is completely free. There is no additional cost associated with the extension, or with changing management modes.
  • Simplified license management: The extension simplifies SQL Server license management, and allows us to quickly identify SQL Server VMs with the Azure Hybrid Benefit using the below commands.

Get-AzSqlVM | Where-Object {$_.LicenseType -eq ‘AHUB’}. ( or)

$ az sql vm list — query “[?sqlServerLicenseType==’AHUB’]”

  • The SQL IaaS Agent extension collects data for the express purpose of giving customers optional benefits when using SQL Server within Azure Virtual Machines.
SQL-Server-Azure-VM-2

The SQL Server IaaS Agent extension unlocks a number of feature benefits for managing your SQL Server VM.

  1. Portal management
  2. Automated backup of DB
  3. Automated patching of VM
  4. Azure Key Vault integration
  5. View disk utilization in portal for VM
  6. Flexible licensing
  7. Flexible version / edition

Three (3) modes of SQL IaaS extension :

  1. Lightweight mode copies extension binaries to the VM, but does not install the agent, and does not restart the SQL Server service. Lightweight mode only supports changing the license type and edition of SQL Server and provides limited portal management.
  2. Full mode installs the SQL IaaS Agent to the VM to deliver all functionality, but requires a restart of the SQL Server service and system administrator permissions.
  3. NoAgent mode is dedicated to SQL Server 2008 and SQL Server 2008 R2 installed on Windows Server 2008. There is no impact to memory or CPU when using the NoAgent mode.

We can view the current mode of your SQL Server IaaS agent by using Azure PowerShell command given below ,

# Get the SqlVirtualMachine
$sqlvm = Get-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName
$sqlvm.SqlManagementType

Installation of SQL IaaS extension :

  1. Login to Azure portal (https://portal.azure.com)
  2. Click on the SQL Virtual machine .
Azure-SQL-Server-3

3. Here we can see the option called as “SQL Automatic VM registration” next to Add button.

Azure-SQL-Server-4
Azure-SQL-Server-5

4. Click on it and we can see the list of subscriptions where we need to add this extension .

Azure-SQL-Server-VM-Registration-6

5. Then if we click on Register , then the agent will be installed on the light mode and then we can start using the benifits .

Azure-SQL-Server-VM-Registration-7

6. We can now login to the VM and check the status of the extension that we have installed .

We can also use the Get-AzVMSqlServerExtension Azure PowerShell cmdlet ,

Get-AzVMSqlServerExtension -VMName “vmname” -ResourceGroupName “resourcegroupname”

Azure-SQL-Server-Script-8

7. We can also see the list of all the DB types installed on Azure in one place called “Azure SQL” . We need to type it on the search bar on Azure and then we can see the PAAS, IAAS, etc in one place where we can use this as an inventory for our official purposes.

Azure-SQL-Server-Agent-9

Limitations:

The SQL IaaS Agent extension only supports:

  • SQL Server VMs deployed through the Azure Resource Manager. SQL Server VMs deployed through the classic model are not supported.
  • SQL Server VMs deployed to the public or Azure Government cloud. Deployments to other private or government clouds are not supported.

Uninstall the agent :

We can use the below powershell command to un register the agent if we are not interested .

Unregister-AzProviderFeature -FeatureName BulkRegistration -ProviderNamespace Microsoft.SqlVirtualMachine

This is the free service given by Microsoft to start leverage the features of this agent as part of the SQL management.

Contact us if you are looking for an Azure training.

Sharing is Caring

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top