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

Unknown's avatar

Author: João Paulo Costa

MCP, MCT, MCSA, MCITP, MCTS, MS, Azure Solutions Architect, Azure Administrator, Azure Network Engineer, Azure Fundamentals, Microsoft 365 Enterprise Administrator Expert, Microsft 365 Messaging Administrator, ITIL v3.

Leave a comment