Skip to content

Commit c66fbc6

Browse files
authored
Merge pull request #294528 from mumian/0212-bicep-export
Export Bicep files from the Azure portal
2 parents 0dbfb0b + 5f7fd78 commit c66fbc6

15 files changed

+75
-11
lines changed

articles/azure-resource-manager/bicep/decompile.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Decompile a JSON Azure Resource Manager template to Bicep
33
description: Learn the commands for decompiling JSON Azure Resource Manager templates to Bicep files.
44
ms.topic: how-to
5-
ms.date: 01/10/2025
5+
ms.date: 02/14/2025
66
ms.custom: devx-track-bicep, devx-track-arm-template
77
---
88

@@ -167,6 +167,9 @@ output storageAccountName string = uniqueStorageName
167167

168168
## Export template and convert
169169

170+
> [!NOTE]
171+
> You can export Bicep files by using the Azure portal. For more information, see [Use Azure portal to export a Bicep file](./export-bicep-portal.md).
172+
170173
You can export the template for a resource group and then pass it directly to the `decompile` command. The following examples show how to decompile an exported template:
171174

172175
# [Azure CLI](#tab/azure-cli)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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).
44.2 KB
Loading
51.3 KB
Loading
37 KB
Loading

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,10 @@
584584
href: deploy-powershell.md
585585
- name: Deploy - Cloud Shell
586586
href: deploy-cloud-shell.md
587+
- name: Export
588+
items:
589+
- name: Portal
590+
href: export-bicep-portal.md
587591
- name: Configure settings
588592
items:
589593
- name: Bicep config file

articles/azure-resource-manager/templates/export-template-portal.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Export template in Azure portal
33
description: Use Azure portal to export an Azure Resource Manager template from resources in your subscription.
44
ms.topic: how-to
55
ms.custom: devx-track-arm-template
6-
ms.date: 10/16/2024
6+
ms.date: 02/12/2025
77
---
88

99
# Use Azure portal to export a template
@@ -32,11 +32,11 @@ To export one or more resources from a resource group:
3232

3333
1. Select **Export template** from the top menu. The **Export template** from the left menu exports all the resources in the group to a template.
3434

35-
1. The exported template is displayed, and is available to download and deploy.
35+
1. Select **ARM Template**. The exported template is displayed, and is available to download and deploy.
3636

3737
:::image type="content" source="./media/export-template-portal/show-template.png" alt-text="Screenshot of the displayed exported template in Azure portal.":::
3838

39-
**Include parameters** is selected by default. When selected, all template parameters are included when the template is generated. If youd like to author your own parameters, toggle this checkbox to not include them.
39+
**Include parameters** is selected by default. When selected, all template parameters are included when the template is generated. If you'd like to author your own parameters, toggle this checkbox to not include them.
4040

4141
## Export template from a resource
4242

@@ -72,6 +72,6 @@ You can export the template that was used to deploy existing resources. The temp
7272

7373
## Next steps
7474

75-
* Learn how to export templates with [Azure CLI](export-template-cli.md), [Azure PowerShell](export-template-powershell.md), or [REST API](/rest/api/resources/resourcegroups/exporttemplate).
75+
* Learn how to export Bicep files with the [Azure portal](../bicep/export-bicep-portal.md).
76+
* Learn how to export templates with [Azure CLI](./export-template-cli.md), [Azure PowerShell](./export-template-powershell.md), or [REST API](/rest/api/resources/resourcegroups/exporttemplate).
7677
* To learn the Resource Manager template syntax, see [Understand the structure and syntax of Azure Resource Manager templates](./syntax.md).
77-
* To learn how to develop templates, see the [step-by-step tutorials](../index.yml).
-15.4 KB
Loading
6.21 KB
Loading
-12.6 KB
Loading

0 commit comments

Comments
 (0)