4

With Azure Hybrid Benefit (AHB), the existing on-premises SQL Server licences can be converted into `40% discount on the price of Azure SQL Managed Instance. If a Managed Instance is already created without AHB, how to apply Azure Hybrid Benefit on the existing Managed Instance?

Jovan MSFT
  • 13,232
  • 4
  • 40
  • 55

2 Answers2

2

The easiest way to convert Managed Instance to AHB is to go to the Azure Portal, open the details of Managed Instance, go to Setting/Pricing tier and confirm that you have valid SA licence that you want to use.

Pricing of Managed Instance can be converted to AHB using AzureRm.Sql PowerShell library and Set-AzureRmSqlManagedInstance command:

Set-AzureRmSqlManagedInstance `
               -Name $instanceName `
               -ResourceGroupName $resourceGroup `
               -LicenseType BasePrice

Instead of AzureRm.Sql you can use AzureRm library and Set-AzureRmResource command:

$subId = "70b3d058-a51a-****-****-**********"
$resourceGroup = "my-resource-group"
$instanceName = "my-instance"

Select-AzureRmSubscription -SubscriptionId $subId

$properties = New-Object System.Object
$properties | Add-Member -type NoteProperty -name licenseType -Value BasePrice

Set-AzureRmResource -Properties $properties `
                    -ResourceName $instanceName `
                    -ResourceType "Microsoft.SQL/managedInstances" `
                    -ResourceGroupName $resourceGroup -Force `
                    -ApiVersion "2015-05-01-preview"

Azure CLI can be used to update license type with az sql mi update command:

az sql mi update -g my_res_group -n my-managed-instance --license-type BasePrice
Jovan MSFT
  • 13,232
  • 4
  • 40
  • 55
1

Another option is using Azure Portal:

  1. At the time of creating managed instance, in the configuration in the portal (where you configure vCores and storage), there is an option to apply AHB (Azure Hybrid Benefit)
  2. Subsequently, once you have managed instance deployed, go to Pricing Tier and you again will have the AHB option offered. Screenshot attached (applies to both)

Enable Azure Hybrid Benefit for Managed Instance in Azure Portal