This issue occurs because there has been a lock placed on the Azure resource you are trying to delete.
Azure sometimes places locks on linked resources or you or another administrator of the system may have put a lock on the resource.
What is a resource lock?
Basically the resource locks stop you from acidentily deleting an Azure resource, it i good practice to put resource locks on production Azure resources to protect from accidential deletion & you can also put notes on the lock so who ever is trying to delete it can see why the lock was put on initially.
How to remove Azure Resource lock so you can delete the Azure resource?
Open the resource you want to delete and select Locks – This is in the settings part of the blade.
Read the comment on the Resource Lock to see why it is applied, if it is safe to delete then you can click the three dots on the right of the Lock and click delete.
Now the resource lock is removed from the Azure Resource, you will be able to delete it.