Upgrade azure VM to Azure VM with SQL STD

Alberto Galvani - personal 1 Reputation point
2021-12-09T14:55:23.867+00:00

Hello,
I have a question for you!
I have had an Azure VM without SQL for several months. Now, without having to redo the VM from scratch, I would have to upgrade the VM to an Azure VM with SQL Standard. Is there any way?
Thanks in advance

SQL Server on Azure Virtual Machines
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andriy Bilous 11,176 Reputation points MVP
    2021-12-09T15:19:37.56+00:00

    Hello @Alberto Galvani - personal

    If you have already deployed an Azure virtual machine and installed SQL Server instance to it you need additionaly add SQL IaaS Extension.

    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.

    • 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

    Here is a link how to register your subscription with the resource provider using Portal
    https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/sql-agent-extension-manually-register-single-vm?tabs=bash%2Cazure-cli#register-subscription-with-rp

    • Register in full mode. 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.
      Azure CLI: az sql vm create --name <vm_name> --resource-group <resource_group_name> --location <vm_location> --license-type <license_type> --sql-mgmt-type Full
      az sql vm update --name <vm_name> --resource-group <resource_group_name> --sql-mgmt-type full

    Here is a link how to register VM with SQL using Azure Portal:
    https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/sql-agent-extension-manually-register-single-vm?tabs=bash%2Cazure-cli#azure-portal-1

    • Check management mode. Use Azure PowerShell to check what management mode your SQL Server IaaS agent extension is in. $sqlvm = Get-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName
      $sqlvm.SqlManagementType

    https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/sql-server-iaas-agent-extension-automate-management?tabs=azure-powershell#named-instance-support
    https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/frequently-asked-questions-faq

    1 person found this answer helpful.
    0 comments No comments

  2. Alberto Galvani - personal 1 Reputation point
    2021-12-09T15:28:45.567+00:00

    Hi Andriy,
    thank you so much for your answer!

    0 comments No comments