@Ahmed Idris Thanks for posting your query on Microsoft Q&A.
To create or delete management locks, you need access to Microsoft.Authorization/*
or Microsoft.Authorization/locks/*
actions. Only the Owner and the User Access Administrator built-in roles can create and delete management locks. You can create a custom role with the required permissions.
- Can you please confirm/ensure that you have the right permissions/role and then try again?
- How did you try to configure lock on your resource/VM, via Azure Portal, CLI, PowerShell, template? Let me know.
Try applying the lock on the resource by following the steps in this document. For example, follow this to achieve this via Azure Portal: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources?tabs=json#portal
- Please share screenshots of the configured lock on Azure Portal.
Let me know the results after trying the suggested steps and I can investigate further. Thanks.