Delete resource with ARM template
With delivery pipeline it is often needed to create and drop resources for the environments.
Currently resource manager does not support deprovision deployment mode.
It means that there is no way to delete exact resources which are specified within the template and were deployed during environment creation.
Unfortunately Delete Resource Group is not an option because often resources are deployed in different resource groups.
Actually Delete is part of Complete mode deployment, could you please just make it separate.
Thanks for the valid suggestion. Your feedback is now open for the user community to upvote & comment on. This allows us to effectively prioritize your request against our existing feature backlog and also gives us insight into the potential impact of implementing the suggested feature.
Terraform and aws CloudFormation have had it for a long time now.
Philipp Molzer commented
I have a use case where this is needed. I do fully automation provisioning and updates to subscriptions, using Azure Blueprints. There are cases where I provision individual UDRs with a resource deployment of "type": "Microsoft.Network/routeTables/routes". I may need to later remove this route, but don't have a way to do so.
Edward Burns commented
I also agree this is essential. Consider this use case.
* Azure solution template that has two plans
1. deploy a Java app server cluster with several VMs.
2. add a node to the cluster, including a VM extension that runs the necessary script to configure the app server cluster to accept the new node.
Now let's say I want to add a plan that deletes a node? Sure, I can have the plan cause a VM extension that run to run a script to configure the app server cluster to remove the node. But I also need to ensure the VM, its NIC, and its Public IP are all de-provisioned as well.
Patrizio Bruno commented
it is more of a necessity than a useful feature, especially in cases where your template fails to deploy an already existing resource and there's no switch (in the template) to say ignore-if-exists
Nishant Bathani commented
It will be really helpful if Azure performs the dependency check when using empty ARM template to delete the resources within the resource group, this avoids maintaining the powershell with different resource types and then execute the delete