Task: Manage Resource Locks

Video: Resource Locks

Estimated time: 5 minutes

Goal

The goal of this task is to verify the function of ARM resource locks. This includes creating resource level and resource group level locks and verify that they prevent unwanted changes to resources.

Pre-requisites

  1. Non-production Azure subscription
  2. Resource group named task-lock-rg
  3. Several resources in the task-lock-rg resource group

Requirements

  1. Requirement 1: Lock a resource
  2. Requirement 2: Lock a resource group

Pre-requisite setup

For this task, you will need to start with a resource group named task-lock-rg. The resource group should contain the following resources:

  1. A route table named lock-rt
  2. A network security group (NSG) named lock-nsg
  3. A virtual network named lock-vnet

You can deploy the resources to your subscription by running the following from a bash cloud shell:

curl https://inedemoassets.blob.core.windows.net/taskfiles/azure_admin/deploy-3509T050-pre.sh | sh

Requirement 1: Lock a resource

For this requirement you will create a read-only lock for the lock-rt route table. You will then attempt to change the Virtual network gateway route propagation setting (if it is disabled, attempt to set it to enabled and save, or vise-versa). Finally you will attempt to delete the task-lock-rg resource group.

Requirement 2: Lock a resource group

For this requirement you will crete a delete lock on the task-lock-rg resource group. You will then attempt to delete the lock-nsg network security group.

Cleanup

To clean up this task, first delete both locks (resource level and resource group level), then delete the task-lock-rg resource group.