|
| 1 | +--- |
| 2 | +title: Export Bicep files in Azure portal |
| 3 | +description: Use Azure portal to export a Bicep file from resources in your subscription. |
| 4 | +ms.topic: how-to |
| 5 | +ms.custom: devx-track-arm-template |
| 6 | +ms.date: 02/25/2025 |
| 7 | +--- |
| 8 | + |
| 9 | +# Use Azure portal to export a Bicep file |
| 10 | + |
| 11 | +[!INCLUDE [Export template intro](../../../includes/resource-manager-export-template-intro.md)] |
| 12 | + |
| 13 | +Currently, Bicep files can only be exported from the Azure portal. However, you can export ARM JSON templates via [Azure CLI](../templates/export-template-cli.md) or [Azure PowerShell](../templates/export-template-powershell.md) and then [decompile](./decompile.md) them into to Bicep files. |
| 14 | + |
| 15 | +[!INCLUDE [Export template limitations](../../../includes/resource-manager-export-template-limitations.md)] |
| 16 | + |
| 17 | +## Export Bicep file from a resource group |
| 18 | + |
| 19 | +To export one or more resources from a resource group: |
| 20 | + |
| 21 | +1. Select the resource group that contains the resources you want to export. |
| 22 | + |
| 23 | +1. Select one or more resources by selecting the checkboxes. To select all, select the checkbox on the left of **Name**. The **Export template** from the top menu only becomes enabled after you've selected at least one resource. |
| 24 | + |
| 25 | + :::image type="content" source="./media/export-bicep-portal/select-all-resources.png" alt-text="Screenshot of selecting all resources for export in Azure portal."::: |
| 26 | + |
| 27 | +1. Select **Export template** from the top menu. The **Export template** from the left menu exports all the resources in the group to a Bicep file. |
| 28 | + |
| 29 | +1. Select **Bicep**. The exported Bicep file is displayed, and is available to download and deploy. |
| 30 | + |
| 31 | + :::image type="content" source="./media/export-bicep-portal/show-template.png" alt-text="Screenshot of the displayed exported Bicep file in Azure portal."::: |
| 32 | + |
| 33 | + All template parameters are included when the Bicep file is generated. |
| 34 | + |
| 35 | +## Export Bicep file from a resource |
| 36 | + |
| 37 | +To export one resource: |
| 38 | + |
| 39 | +1. Select the resource group containing the resource you want to export. |
| 40 | + |
| 41 | +1. Select the resource that you want to export to open the resource. |
| 42 | + |
| 43 | +1. For that resource, select **Export template** in the left pane. |
| 44 | + |
| 45 | + :::image type="content" source="./media/export-bicep-portal/export-single-resource.png" alt-text="Screenshot of exporting a single resource in Azure portal."::: |
| 46 | + |
| 47 | +1. Select **Bicep**. The exported Bicep file is displayed, and is available to download and deploy. The Bicep file only contains the single resource. All template parameters are included when the Bicep file is generated. |
| 48 | + |
| 49 | +## Export template after deployment |
| 50 | + |
| 51 | +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](./decompile.md) them into to Bicep files. For more information about saving from history and the export options, see [Choose the right export option](../templates/export-template-portal.md#choose-the-right-export-option). |
| 52 | + |
| 53 | +## Next steps |
| 54 | + |
| 55 | +* Learn how to export ARM JSON templates with [Azure CLI](../templates/export-template-cli.md), [Azure PowerShell](../templates/export-template-powershell.md), or [REST API](/rest/api/resources/resourcegroups/exporttemplate). |
| 56 | +* Learn the [Bicep file structure and syntax](./file.md). |
| 57 | +* Learn how to [decompile ARM JSON templates to Bicep](./decompile.md). |
0 commit comments