Articles → MICROSOFT AZURE → Apply Locks On The Resource Group Using Powershell And CLI In Azure

Apply Locks On The Resource Group Using Powershell And CLI In Azure






Resource Group




Picture showing the resource group on which lock will be applied
Click to Enlarge




Powershell Script




New-AzResourceLock -LockName "mylock" -LockLevel "CanNotDelete" -ResourceGroupName "RG1111"



Output


Picture showing the lock applied on the resource group using powershell
Click to Enlarge


Apply Lock Using CLI




az group lock create --lock-type CanNotDelete -n rglock -g 'rg1111'





Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, November 17, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250