Search code examples
azureazure-resource-managerazure-logic-appsazure-resource-group

delete a resource group via template.json in azure resource management


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


Solution

  • 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.