I have created a template to deploy a service bus (ServiceBus/namespace) and three "nested"/"tiered" resources: topics (ServiceBus/namespace/topics), queues (ServiceBus/namespace/queues), and authorisation rules (ServiceBus/namespace/authorizationrules). And the resources are built correctly.
However, I want the entire service bus and it's tiered resources to be fully customisable from the parameter file. for the tiered resources this works when adding new resources, and adjusting existing resources in the parameter file however I cannot find a way to delete tiered resources that are not deployed by the template.
I have tried complete deployment mode (even though I only want resources in the service bus hierarchy to be deleted) however the tiered resources are not destroyed in the same was as resources directly beneath the resource group (i.e. the service bus itself). I have tried entirely deleting the service bus and rebuilding it, but this causes all the keys for the authorisation rules (shared access policies) to change.
If anyone knows if, and how, I can get the functionality I desire it would be greatly appreciated
If you want to "clean up" child resources that were not defined in the template that may or may not work depending on how ARM recognizes the resources. TL;DR if it's not working with complete mode as you tried it, ARM doesn't recognize those resources in a way that would clean up the extra ones.
There is an upcoming feature called deploymentStacks
that will help with this scenario but today the capabilities are as you have it.
You could script a more surgical removal of those resources after deployment finishes by leveraging deploymentOperations but there's nothing more "built-in" today.