Azure

Removing Azure Locks from Resource Group using PowerShell

Today’s post is quick and simple folks. In today’s article I will show you how to remove Azure Locks from a Resource Group.

First let’s declare the Resource group variable:
$Resource = “RG_GETPRACTICAL”

AzLocks_01

After the declared variable we can execute the command “Get-AzResourceLock” using a pipe “|” so we can refer to the Resource Group same as the variable above.

And then the command to check if the $Resource has a “Lock” enabled:

Get-AzResourceLock | where ResourceGroupName -EQ $Resource

AzLocks_02

Finally, we can remove the lock:

Get-AzResourceLock | where ResourceGroupName -EQ $Resource | Remove-AzResourceLock –Force

AzLocks_03

Quick post today, that’s all folks.

Joao Paulo Costa

Leave a Reply

Discover more from Get Practical

Subscribe now to keep reading and get access to the full archive.

Continue reading