I’d like to export only the resource definitions.
Is it feasible to remove elements that aren’t needed? I’d like to convert this template to Bicep (in order to deploy all of the resources into a new subscription), but first I need to manually remove all of the unused things from the exported ARM template.
Asked by boj
Thank you very much, Gopa. Adding your suggestion as a response to assist other members of the community.
When you export an ARM template from a resource group or resource, you get a template that is a snapshot of the current properties, meaning it includes all the properties that have changed since the initial deployment.
You can also export templates from the deployment history, which will allow you to export your initial version without any changes done after each deployment.
You can keep all resources in source control as ARM templates and utilize CI/CD to deploy anytime there is a change, so you can always have the most up-to-date ARM templates and use them to create a new environment whenever the need arises.
You can export the template that was used to deploy existing resources. The template you get is exactly the one that was used for deployment.
After deployment, export the template.
Answered by DeepDave-MT
Post is based on https://stackoverflow.com/questions/69146658/filter-verbose-azure-arm-template