Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 2.78 KB

File metadata and controls

36 lines (26 loc) · 2.78 KB
author mumian
ms.service azure-resource-manager
ms.topic include
ms.date 02/14/2025
ms.author jgao

Choose the right export option

There are two ways to export a template:

  • Export from resource group or resource. This option generates a new template from existing resources. The exported template is a "snapshot" of the current state of the resource group. You can export an entire resource group or specific resources within that resource group.

  • Save from history. This option supports exporting only ARM JSON templates. It retrieves an exact copy of the template used for deployment, allowing you to select a specific deployment from the deployment history. After exporting, you can decompile them into to Bicep files.

Depending on the option you choose, the exported templates have different qualities.

From resource group or resource From history
Template is autogenerated. You'll probably want to improve the code before deploying it. Template is an exact copy of the one created by the template author. It's ready to be redeployed without any changes.
Template is snapshot of the resources' current state. It includes any manual changes you made after deployment. Template only shows state of resources at the time of deployment. Any manual changes you made after deployment aren't included.
You can select which resources from a resource group to export. All resources for a specific deployment are included. You can't pick a subset of those resources or add resources that were added at a different time.
Template includes all properties for the resources, including some properties you wouldn't normally set during deployment. You might want to remove or clean up these properties before reusing the template. Template includes only the properties needed for the deployment. The template is more sparse and easier to read.
Template probably doesn't include all of the parameters you need for reuse. Most property values are hard-coded in the template. To redeploy the template in other environments, you need to add parameters that increase the ability to configure the resources. You can unselect Include parameters so that you can author your own parameters. Template includes parameters that make it easy to redeploy in different environments.

Export the template from a resource group or resource, when:

  • You need to capture changes to the resources that were made after the original deployment.
  • You want to select which resources are exported.
  • The resources weren't created with a template.

Export the template from the history, when:

  • You want an easy-to-reuse template.
  • You don't need to include changes you made after the original deployment.