Objectives
In this article, we will:
- 1: Create resource groups and deploy resources to resource groups
- 2: Move resources between resource groups
- 3: Implement and test resource locks
1: Create resource groups and deploy resources to resource groups
we will use the Azure portal to create resource groups and create a disk in the resource group.
Sign in to the https://portal.azure.com.
In the Azure portal, search for and select Disks, click + Add, + Create, or + New, and specify the following settings:
Setting Value Subscription the name of the Azure subscription where you created the resource group Resource Group the name of a new resource group az104-03a-rg1 Disk name az104-03a-disk1 Region the name of the Azure region where you created the resource group Availability zone None Source type None When creating a resource, you have the option of creating a new resource group or using an existing one.
Change the disk type and size to Standard HDD and 32 GiB, respectively.
Click Review + Create and then click Create.
Wait until the disk is created. This should take less than a minute.
2: Move resources between resource groups
we will move the disk resource you created in the previous task to a new resource group.
Search for and select Resource groups.
On the Resource groups blade, click the entry representing the az104-03a-rg1 resource group you created in the previous task.
From the Overview blade of the resource group, in the list of resource group resources, select the entry representing the newly created disk, click Move in the toolbar, and, in the drop-down list, select Move to another resource group.
This method allows you to move multiple resources at the same time.
On the Move resources blade, click Create a new group.
Below the Resource group text box, click Create new then type az104-03a-rg2 in the text box. On the Review tab, select the checkbox I understand that tools and scripts associated with moved resources will not work until I update them to use new resource IDs, and click Move.
Do not wait for the move to complete but instead proceed to the next task. The move might take about 10 minutes. You can determine that the operation was completed by monitoring activity log entries of the source or target resource group. Revisit this step once you complete the next task.
we will apply a resource lock to an Azure resource group containing a disk resource.
In the Azure portal, search for and select Disks, click + Add, + Create, or + New, and specify the following settings:
Setting Value Subscription the name of the subscription you are using in this lab Resource Group click create new resource group and name it az104-03a-rg3 Disk name az104-03a-disk2 Region the name of the Azure region where you created the other resource groups in this lab Availability zone None Source type None Set the disk type and size to Standard HDD and 32 GiB, respectively.
Click Review + Create and then click Create.
Click Go to resouce.
On the az104-03a-rg3 resource group blade, click Locks then + Add and specify the following settings:
Setting Value Lock name az104-03a-delete-lock Lock type Delete Click OK
On the az104-03a-rg3 resource group blade, click Overview, in the list of resource group resources, select the entry representing the disk you created earlier in this task, and click Delete in the toolbar.
When prompted Do you want to delete all the selected resources?, in the Confirm delete text box, type yes and click Delete.
You should see an error message, notifying about the failed delete operation.
As the error message states, this is expected due to the delete lock applied on the resource group level.
Navigate back to the list of resources of the az104-03a-rg3 resource group and click the entry representing the az104-03a-disk2 resource.
On the az104-03a-disk2 blade, in the Settings section, click Size + performance, set the disk type and size to Premium SSD and 64 GiB, respectively, and click Resize to apply the change. Verify that the change was successful.
This is expected, since the resource group-level lock applies to delete operations only.
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments