I have a DevOps pipeline that I use to deploy my resource group (with an ARM template).
I have a readonly lock on my resource group. At the beginning of my pipeline, I run a Azure CLI script task to remove the locks. It runs fine.
Right after, in the same pipeline, I have an ARM template deployment task.
When my ARM template deployment task runs, it fails, saying that my resource group is still locked.
If I wait a certain time (a few minutes) and re-run the ARM template deployment task, it runs fine.
It seems there is a delay in the lock deletion task. Is there such a thing? I can't find any mention of a lock deletion delay in the documentation.
What would be the best approach to this?