What is impact of Read lock on a Resource Group during a VM Move

Shridhar Srinivasan 215 Reputation points
2023-07-13T08:26:21.6833333+00:00

I have a Resource group RG1 with a virtual machine in west-us availability zone AZ1

I have a Resource group RG2 in west-us availability zone AZ1

RG2 has a ReadOnly Lock

Can I move VM1 to RG2


I have a Resource group RG1 with a virtual machine in west-us availability zone AZ1

I have a Resource group RG2 in west-us availability zone AZ1

RG1 has a ReadOnly Lock

Can I move VM1 to RG2

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
6,793 questions
{count} votes

Accepted answer
  1. Prrudram-MSFT 20,761 Reputation points
    2023-07-13T08:45:25.1+00:00

    @Shridhar Srinivasan

    Thank you for reaching out to the Microsoft Q&A platform.

    If a resource group has a read-only lock, you cannot move any resources from that resource group to another resource group. Therefore, in both scenarios you mentioned, you cannot move the virtual machine to the other resource group if the source resource group has a read-only lock.

    A read-only lock on a resource group prevents all users from deleting or modifying any resources in the resource group, including moving resources to another resource group. However, users can still read the resources in the resource group.

    If you want to move the virtual machine to another resource group, you need to remove the read-only lock from the source resource group first. Once the lock is removed, you can move the virtual machine to the target resource group using the Azure portal, Azure PowerShell, or Azure CLI.

    If this does answer your question, please accept it as the answer as a token of appreciation.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful