Skip to content

Commit f6e327c

Browse files
committed
Export Bicep files from the Azure portal
1 parent ca029bb commit f6e327c

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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/12/2025
7+
---
8+
9+
# Use Azure portal to export a template
10+
11+
[!INCLUDE [Export template intro](../../../includes/resource-manager-export-template-intro.md)]
12+
13+
This article shows how to export templates through the **portal**. For other options, see:
14+
15+
* [Export template with Azure CLI](export-template-cli.md)
16+
* [Export template with Azure PowerShell](export-template-powershell.md)
17+
* [REST API export from resource group](/rest/api/resources/resourcegroups/exporttemplate) and [REST API export from deployment history](/rest/api/resources/deployments/export-template).
18+
19+
[!INCLUDE [Export template choose option](../../../includes/resource-manager-export-template-choose-option.md)]
20+
21+
[!INCLUDE [Export template limitations](../../../includes/resource-manager-export-template-limitations.md)]
22+
23+
## Export template from a resource group
24+
25+
To export one or more resources from a resource group:
26+
27+
1. Select the resource group that contains the resources you want to export.
28+
29+
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.
30+
31+
:::image type="content" source="./media/export-template-portal/select-all-resources.png" alt-text="Screenshot of selecting all resources for export in Azure portal.":::
32+
33+
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.
34+
35+
1. The exported template is displayed, and is available to download and deploy.
36+
37+
:::image type="content" source="./media/export-template-portal/show-template.png" alt-text="Screenshot of the displayed exported template in Azure portal.":::
38+
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.
40+
41+
## Export template from a resource
42+
43+
To export one resource:
44+
45+
1. Select the resource group containing the resource you want to export.
46+
47+
1. Select the resource that you want to export to open the resource.
48+
49+
1. For that resource, select **Export template** in the left pane.
50+
51+
:::image type="content" source="./media/export-template-portal/export-single-resource.png" alt-text="Screenshot of exporting a single resource in Azure portal.":::
52+
53+
1. The exported template is displayed, and is available to download and deploy. The template only contains the single resource. **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.
54+
55+
## Export template after deployment
56+
57+
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.
58+
59+
1. Select the resource group you want to export.
60+
61+
1. Select the link under **Deployments**.
62+
63+
:::image type="content" source="./media/export-template-portal/select-deployment-history.png" alt-text="Screenshot of selecting deployment history in Azure portal.":::
64+
65+
1. Select one of the deployments from the deployment history.
66+
67+
:::image type="content" source="./media/export-template-portal/select-details.png" alt-text="Screenshot of selecting a specific deployment from deployment history in Azure portal.":::
68+
69+
1. Select **Template**. The template used for this deployment is displayed, and is available for download.
70+
71+
:::image type="content" source="./media/export-template-portal/show-template-from-history.png" alt-text="Screenshot of selecting the template used for a specific deployment in Azure portal.":::
72+
73+
## Next steps
74+
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).
76+
* 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).

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

0 commit comments

Comments
 (0)