Forum Discussion

JasonYeung's avatar
JasonYeung
Brass Contributor
Oct 17, 2025

Creating Azure SQL VM with same name as VM

Hi,

Currently we have a resource group, which contains a Virtual Machine and SQL Virtual Machine (and a few other resources). The VM and SQL VM has the same name:

 

I want to move this resource group (and its resources) to another subscription. We tried using Resource Mover, but we couldn't as there are backups. I tried the steps in the following link:

https://petri.com/copy-azure-vm-using-managed-disk-snapshots/

I was successful in moving 5 of the 6 resources to the new subscription, but was unable to move the SQL virtual machine:

 

I tried to create a SQL virtual machine, but it says I can't create one with the same name:

 

I found that in order to create a VM and SQL VM's with the same name, in the above image, I have to choose an image that has SQL Server and Windows. But this doesn't allow me to use the original managed disk (it only has an OS disk) and it also creates a couple of more disks, which are not in the original resource group.

I was wondering if there are recommendations on how to create a SQL VM that has the same name as the VM in the same resource group and are also linked to each other.

Jason

1 Reply

  • You may try this to recreate the SQL VM resource and link it to your existing VM (with SQL Server already installed):

    1. Ensure SQL Server is installed on the VM and properly configured.
    2. Use PowerShell or Azure CLI to register the SQL VM resource manually:
      • This avoids using the marketplace image and lets you reuse the original OS disk.
    Register-AzSqlVM -ResourceGroupName "YourRG" -Name "YourVMName" -LicenseType PAYG

     

      • This command links the SQL VM metadata to your existing VM without creating new disks.
    1. If the name conflict persists, you may need to:
      • Temporarily rename the VM or SQL VM resource.
      • Register the SQL VM resource.
      • Rename it back after successful registration.

Resources