Tag: Azure Resource Management

Azure

Moving your Azure Resources to Another Subscription or Resource Group

At some point or another you may  need to move your Azure resources to either another Azure Resource Group or to another Azure Subscription. This is easy to do and is useful when organizing your resources for management or billing scenarios. Before moving any resources it’s best to take a look at the following checklist before moving resources link.

Ok let’s get started. In this example I’ll be moving an Azure Resource Group with a number of services over to another Azure Subscription.

Steps to move resources

Step 1 – Navigate to the resource group you want to move. Go to the Resource groups blade in the Azure portal and then navigate to the particular resource group.

image

Step 2 – Click on Move button and then select Move to another subscription option.

image

Step 3 – Next in the resources to move screen, review the resources that are to be moved over which are all automatically selected. Then select the subscription and resource group you want to move target. If the resource group is not already created, you can create it now by clicking on the link to create a new resource group.

image

Step 4 – Now click on the OK button to start the process. The job will then be validated and then you will see a notification of the movement in progress, followed by a success or failure notification. In the event of a failure, details will be provided on why the resources could not be moved. Usually after working through these issues you can try again.

image

image

Step 5 – You should now go to the new resource group you created and verify all the resources are accounted for and that the resources still function as intended.

Step 6 – Finally you want to tidy up and delete the original resource group on the source subscription as it’s now empty and should not be used again. To do this go to the original resource group and click on Delete resource group button. You will be prompted to type in the name of the resource group to confirm you want to continue.

image

Summary

This article covered moving a resource group and all of its resources from one subscription to another. The same process is applicable when moving resources from one resource group to another within the same subscription.

Enjoy!

References

Move resources to new resource group or subscription

Azure

How to Lock Azure Resources and Prevent Unexpected Changes or Deletions

Management locks can help you prevent accidental deletion or modification of your Azure resources. You can manage these locks from one of the following…the Azure Portal, ARM Templates, PowerShell, Azure CLI, or the REST API. To view, add, or delete locks, go to the Locks section of any resource’s settings blade. In the Azure Portal, the locks are called Delete and Read-Only respectively.

There are two possible types of locks on a resource:

  • CanNotDetele – This means authorized users can still read and modify a resource, but they can’t delete the resource.
  • ReadOnly – This means authorized users can read a resource, but they can’t delete or update the resource. Applying this lock is similar to restricting all authorized users to the permissions granted by the Reader role.

When a lock is applied at the parent level, all resources within that scope inherit the same lock. This applies to any resources you add later on to this parent resource. Resource locks do not restrict how a particular resource functions and only resource changes are restricted, but the most restrictive lock will always take precedence.

Creating a Lock using the Portal

1. In the portal, go to the particular resource you want to lock. In this case it’s a Resource Group but it could be any Resource, a Resource Group, or a Subscription  and then click on the Lock option under the Settings section:

image

2. To add a lock click on the Add button:

image

3. Give your lock a name and the type of lock (Delete or Read-Only) and then click on the OK button:

image

Your resources are now locked. If you try to delete a resource that is locked you will see the following warning which prevents you from deleting the particular resource:

image

Unlocking a Resource

To unlock the resource click on the ellipse (…) button and click on the Delete option:

image

Using resource locks is a must and really prevents an “oops…I deleted the wrong resource” situation which leads to accidental and hard to recover from downtown.

Enjoy!

Resources

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-lock-resources

Lock Down your Azure Resources

Remove Locks from Azure Resources