2
votes

I want to delete the resource group on failure of any resources deployment.

and main note here is that i should not use logic app for this resource group deletion, i should use template.json file alone.

is there any possibility to delete a resource group via template.json

1
You can not delete the resource group using template.json alone.There are many other ways by which you can delete resource group i-e by script, Azure-cli or Azure web interface.Hamza Anis
@HamzaAnis Thanks man,sathya
I want to roll back all my deployments once on of my deployment got failed(even the succeeded deployments as well). so is there any better way for this to happen in azure resource group automation.sathya

1 Answers

3
votes

As far as I know, we couldn't delete a resource group via template.json.

If you want to achieve this, I suggest you could write your own logic (using script or codes) to check the template deployment result. If result throws an exception then you could run the script or code (azure management rest api send the request to azure) or powershell command to remove the resource group.

Besides, someone has same requirement and send the feedback (Link) to azure team. I suggest you could vote this and wait for azure product team reply.