Questions tagged [azure-resource-lock]

Azure subscriptions, resource groups, and resources can be protected from accidental deletions and modifications through the use of resource locks. This tag is for discussing the use, management and scope of resource locks.

Overview

Azure subscriptions, resource groups, and resources can be protected from accidental deletions and modifications through the use of resource locks.

You can set locks that prevent either deletions or modifications. In the portal, these locks are called Delete and Read-only. In the command line, these locks are called CanNotDelete and ReadOnly.

See also

20 questions
0
votes
1 answer

Azure Resource Lock through policy but delete through DevOps

In this link a policy to lock resource group is given. Once it is implemented I would like the Devops pipeline to delete resources(as part of re-creation). I do not want the policy to prevent me from doing this(or temporarily allow me). How can I do…
Blue Clouds
  • 7,295
  • 4
  • 71
  • 112
0
votes
1 answer

Azure Automation - Unable to Remove-AzResourceLock

I have an issue deleting an Azure Lock, at the resource group level. I am doing it from an Azure Runbook. I authenticate fine (I am able to Get details of whatever I want). Here's the code for that: # Ensures you do not inherit an AzureRMContext in…
0
votes
1 answer

Automatically lock resources based on the tags - Microsoft Azure

I would like to find a way to automatically lock resources when they have a specific tag and value in Microsoft Azure. For example, if the resource has a tag "Important resource" set to "yes", a "CanNotDelete" lock should be created on this…
RanHuf
  • 3
  • 2
0
votes
1 answer

Azure resource deletion locks preventing deletion of role assignment on the resource

I have applied deletion lock on my subscription level so that all the resource will get the locks, while revoked the access from virtual machines, azure deletion lock is preventing the IAM role deletion, Is there any way to fix it?
0
votes
1 answer

Azure Resource Lock - Bypassed by Powershell Remove-AzureVM

In my Azure Subscription... Created a new Resource Group LOCK using Powershell for a CLASSIC Resource Group. New-AzureRmResourceLock -LockLevel CanNotDelete -LockName MYRG_DeleteLock -ResourceGroupName MYRG I have a CLASSIC Stoage Account and a…
Jenson Joseph
  • 51
  • 1
  • 4
1
2