azure-docs
azure-docs copied to clipboard
It seems that setting azure resource lock will result many problems, so what the meaning of it?
[Enter feedback here]
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 4e7af209-7240-dd2a-7130-e7fb3143986a
- Version Independent ID: a653b0d1-877d-09f7-17fa-11bf06c37cc9
- Content: Protect your Azure resources with a lock - Azure Resource Manager
- Content Source: articles/azure-resource-manager/management/lock-resources.md
- Service: azure-resource-manager
- Sub-service: management
- GitHub Login: @tfitzmac
- Microsoft Alias: tomfitz
@hsszlll Thanks for reaching out. There are certain things you need to consider when applying a lock to resource. Each resource when applied with lock impacts the operations that can be performed by respective resource. The document you are referring to provides the impacts or problems you may encounter based on the resource type when locks are applied.
@SwathiDhanwada-MSFT Thanks for reply. In order to protect our azure resource from accidentally deleted, I want to set can not delete lock on resource, but it exists some impacts or problems, so I have to give up this plan, do you known some better way to achieve this?
@hsszll Resources Locks are the recommended option. Can you please let me know for which resource are you trying to apply lock for?
@SwathiDhanwada-MSFT We have these resources to lock
@hsszlll - a cannot-delete lock works with most resource types. You could apply locks to individual resources rather than the resource group to avoid problems with features like auto-deleting deployments from the history. What concerns do you have about applying cannot-delete locks to the resource types you listed?
@tfitzmac So we can set lock on resource rather than resource group. But I still have a question for you to answer.Although I don't set lock on resource group, but due to Lock inheritance(showing in follow figure), the deletion will still fail.
The lock prevents you from deleting the resource group, which is what you would want if you have a cannot-delete lock on one of the resources. It doesn't prevent you from individually deleting other resources that aren't locked.
Thanks @tfitzmac , what fact I known is setting lock on resource will influence deletion of resource group, setting lock on resource group will influence auto-deleting deployments history, so that whether setting lock on resource will influence auto-deleting deployments history? If the answer is no, I will with no concer to set can-not lock on resources.
No, setting a lock on a resource does not affect auto-deleting deployment history.
@hsszll Did you get chance to look into tfitzmac's comment ? Do revert if you have further questions.
We'll close this for now, but feel free to reopen if needed. #please-close