Delete created resources if deployment failed

Keren Zubovsky 21 Reputation points

I am using Python SDK to create a deployment with 2 resources.
In case the deployment fails - is there a flag or a parameter that can be passed to begin_create_or_update deployment function that will cause created resources to be deleted?
Is there any other way?


Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Joe Carlyle 661 Reputation points MVP


    There is no delete operation that you can run explicitly.

    However, you could create an empty template and deploy that in complete mode rather than incremental, this would remove that NIC for your next deployment. Obviously you would need to add the logic on your side to catch the failure and deploy the empty template -