You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/modules.md
+33-14Lines changed: 33 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@ title: Bicep modules
3
3
description: Describes how to define a module in a Bicep file, and how to use module scopes.
4
4
ms.topic: conceptual
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 02/02/2024
6
+
ms.date: 06/28/2024
7
7
---
8
8
9
9
# Bicep modules
10
10
11
-
Bicep enables you to organize deployments into modules. A module is a Bicep file (or an ARM JSON template) that is deployed from another Bicep file. With modules, you improve the readability of your Bicep files by encapsulating complex details of your deployment. You can also easily reuse modules for different deployments.
11
+
Bicep enables you to organize deployments into modules. A module is a Bicep file (or an Azure Resource Manager JSON template) that is deployed from another Bicep file. With modules, you improve the readability of your Bicep files by encapsulating complex details of your deployment. You can also easily reuse modules for different deployments.
12
12
13
-
To share modules with other people in your organization, create a [template spec](../bicep/template-specs.md), [public registry](https://github.com/Azure/bicep-registry-modules), or [private registry](private-module-registry.md). Template specs and modules in the registry are only available to users with the correct permissions.
13
+
To share modules with other people in your organization, create a [template spec](../bicep/template-specs.md), or [private registry](private-module-registry.md). Template specs and modules in the registry are only available to users with the correct permissions.
14
14
15
15
> [!TIP]
16
16
> The choice between module registry and template specs is mostly a matter of preference. There are a few things to consider when you choose between the two:
@@ -19,7 +19,7 @@ To share modules with other people in your organization, create a [template spec
19
19
> - Content in the Bicep module registry can only be deployed from another Bicep file. Template specs can be deployed directly from the API, Azure PowerShell, Azure CLI, and the Azure portal. You can even use [`UiFormDefinition`](../templates/template-specs-create-portal-forms.md) to customize the portal deployment experience.
20
20
> - Bicep has some limited capabilities for embedding other project artifacts (including non-Bicep and non-ARM-template files. For example, PowerShell scripts, CLI scripts and other binaries) by using the [`loadTextContent`](./bicep-functions-files.md#loadtextcontent) and [`loadFileAsBase64`](./bicep-functions-files.md#loadfileasbase64) functions. Template specs can't package these artifacts.
21
21
22
-
Bicep modules are converted into a single Azure Resource Manager template with [nested templates](../templates/linked-templates.md#nested-template). For more information about how Bicep resolves configuration files and how Bicep merge user-defined configuration file with the default configuration file, see [Configuration file resolution process](./bicep-config.md#understand-the-file-resolution-process) and [Configuration file merge process](./bicep-config.md#understand-the-merge-process).
22
+
Bicep modules are converted into a single Azure Resource Manager template with [nested templates](../templates/linked-templates.md#nested-template). For more information about how Bicep resolves configuration files and how Bicep merges user-defined configuration file with the default configuration file, see [Configuration file resolution process](./bicep-config.md#understand-the-file-resolution-process) and [Configuration file merge process](./bicep-config.md#understand-the-merge-process).
23
23
24
24
### Training resources
25
25
@@ -81,7 +81,7 @@ Like resources, modules are deployed in parallel unless they depend on other mod
81
81
82
82
## Path to module
83
83
84
-
The file for the module can be either a local file or an external file. The external file can be in template spec or a Bicep module registry. All of these options are shown below.
84
+
The file for the module can be either a local file or an external file. The external file can be in template spec or a Bicep module registry.
85
85
86
86
### Local file
87
87
@@ -95,30 +95,42 @@ For example, to deploy a file that is up one level in the directory from your ma
95
95
96
96
#### Public module registry
97
97
98
-
The public module registry is hosted in a Microsoft container registry (MCR). The source code and the modules are stored in [GitHub](https://github.com/azure/bicep-registry-modules). To view the available modules and their versions, see [Bicep registry Module Index](https://aka.ms/br-module-index).
98
+
> [!NOTE]
99
+
> Non-AVM (Azure Verified Modules) modules are retired from the public module registry.
100
+
101
+
[Azure Verified Modules](https://azure.github.io/Azure-Verified-Modules/) are prebuilt, pretested, and preverified modules for deploying resources on Azure. Created and owned by Microsoft employees, these modules are designed to simplify and accelerate the deployment process for common Azure resources and configurations whilst also aligning to best practices; such as the Well-Architected Framework.
99
102
100
-
:::image type="content" source="./media/modules/bicep-public-module-registry-modules.png" alt-text="The screenshot of public module registry.":::
103
+
Browse to the [Azure Verified Modules Bicep Index](https://azure.github.io/Azure-Verified-Modules/indexes/bicep/)to see the list of modules available, select the highlighted numbers in the following screenshot to be taken directly to that filtered view.
101
104
102
-
Select the versions to see the available versions. You can also select **Source code** to see the module source code, and open the Readme files.
105
+
:::image type="content" source="./media/modules/bicep-azure-verified-modules-avm.png" alt-text="The screenshot of Azure Verified Modules (AVM).":::
103
106
104
-
There are only a few published modules currently. More modules are coming. If you like to contribute to the registry, see the [contribution guide](https://github.com/Azure/bicep-registry-modules/blob/main/CONTRIBUTING.md).
107
+
The module list shows the latest version. Select the version number to see a list of available versions:
105
108
106
-
To link to a public registry module, specify the module path with the following syntax:
109
+
:::image type="content" source="./media/modules/bicep-azure-verified-modules-avm-version.png" alt-text="The screenshot of Azure Verified Modules(AVM) versions.":::
110
+
111
+
To link to a public module, specify the module path with the following syntax:
description: Learn how to set up an Azure container registry for private Bicep modules
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 05/10/2024
6
+
ms.date: 06/28/2024
7
7
---
8
8
9
9
# Create private registry for Bicep modules
10
10
11
-
To share [modules](modules.md) within your organization, you can create a private module registry. You publish modules to that registry and give read access to users who need to deploy the modules. After the modules are shared in the registries, you can reference them from your Bicep files. To contribute to the public module registry, see the [contribution guide](https://github.com/Azure/bicep-registry-modules/blob/main/CONTRIBUTING.md).
11
+
To share [modules](modules.md) within your organization, you can create a private module registry. You can then publish modules to that registry and give read access to users who need to deploy the modules. After the modules are shared in the registries, you can reference them from your Bicep files. To use public modules, see [Bicep Modules](./modules.md#file-in-registry).
12
12
13
13
To work with module registries, you must have [Bicep CLI](./install.md) version **0.4.1008 or later**. To use with Azure CLI, you must also have version **2.31.0 or later**; to use with Azure PowerShell, you must also have version **7.0.0** or later.
14
14
@@ -55,7 +55,7 @@ A Bicep registry is hosted on [Azure Container Registry (ACR)](../../container-r
55
55
56
56
## Publish files to registry
57
57
58
-
After setting up the container registry, you can publish files to it. Use the [publish](bicep-cli.md#publish) command and provide any Bicep files you intend to use as modules. Specify the target location for the module in your registry. The publish command will create an ARM template which will be stored in the registry. This means if publishing a Bicep file that references other local modules, these modules will be fully expanded as one JSON file and published to the registry.
58
+
After setting up the container registry, you can publish files to it. Use the [publish](bicep-cli.md#publish) command and provide any Bicep files you intend to use as modules. Specify the target location for the module in your registry. The publish command creates an ARM template, which is stored in the registry. This means if publishing a Bicep file that references other local modules, these modules are fully expanded as one JSON file and published to the registry.
With the with source switch, you see an additional layer in the manifest:
94
+
With the with source switch, you see another layer in the manifest:
95
95
96
96
:::image type="content" source="./media/private-module-registry/bicep-module-with-source-manifest.png" lightbox="./media/private-module-registry/bicep-module-with-source-manifest.png" alt-text="Screenshot of bicep module registry with source.":::
97
97
98
-
Note that if the Bicep module references a module in a Private Registry, the ACR endpoint will be visible. To hide the full endpoint, you can configure an alias for the private registry.
98
+
If the Bicep module references a module in a Private Registry, the ACR endpoint is visible. To hide the full endpoint, you can configure an alias for the private registry.
99
99
100
100
## View files in registry
101
101
@@ -105,9 +105,9 @@ To see the published module in the portal:
105
105
1. Search for **container registries**.
106
106
1. Select your registry.
107
107
1. Select **Services** -> **Repositories** from the left menu.
108
-
1. Select the module path (repository). In the preceding example, the module path name is **bicep/modules/storage**.
108
+
1. Select the module path (repository). In the preceding example, the module path name is **bicep/modules/storage**.
109
109
1. Select the tag. In the preceding example, the tag is **v1**.
110
-
1. The **Artifact reference** matches the reference you'll use in the Bicep file.
110
+
1. The **Artifact reference** matches the reference you use in the Bicep file.
@@ -116,7 +116,7 @@ You're now ready to reference the file in the registry from a Bicep file. For ex
116
116
---
117
117
## Working with Bicep registry files
118
118
119
-
When leveraging bicep files that are hosted in a remote registry, it's important to understand how your local machine will interact with the registry. When you first declare the reference to the registry, your local editor will try to communicate with the Azure Container Registry and download a copy of the registry to your local cache.
119
+
When using bicep files that are hosted in a remote registry, it's important to understand how your local machine interacts with the registry. When you first declare the reference to the registry, your local editor tries to communicate with the Azure Container Registry and download a copy of the registry to your local cache.
120
120
121
121
The local cache is found in:
122
122
@@ -138,17 +138,16 @@ The local cache is found in:
138
138
~/.bicep
139
139
```
140
140
141
-
Any changes made to the remote registry will not be recognized by your local machine until a `restore` has been ran with the specified file that includes the registry reference.
141
+
Your local machine can recognize any changes made to the remote registry until you run a `restore` with the specified file that includes the registry reference.
142
142
143
143
```azurecli
144
144
az bicep restore --file <bicep-file> [--force]
145
145
```
146
146
147
-
For more information refer to the [`restore` command.](bicep-cli.md#restore)
148
-
147
+
For more information, see the [`restore` command.](bicep-cli.md#restore)
149
148
150
149
## Next steps
151
150
152
-
* To learn about modules, see [Bicep modules](modules.md).
153
-
* To configure aliases for a module registry, see [Add module settings in the Bicep config file](bicep-config-modules.md).
154
-
* For more information about publishing and restoring modules, see [Bicep CLI commands](bicep-cli.md).
151
+
- To learn about modules, see [Bicep modules](modules.md).
152
+
- To configure aliases for a module registry, see [Add module settings in the Bicep config file](bicep-config-modules.md).
153
+
- For more information about publishing and restoring modules, see [Bicep CLI commands](bicep-cli.md).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/quickstart-private-module-registry.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
title: Publish modules to private module registry
3
3
description: Publish Bicep modules to private module registry and use the modules.
4
-
ms.date: 06/20/2024
4
+
ms.date: 06/28/2024
5
5
ms.topic: quickstart
6
6
ms.custom: mode-api, devx-track-bicep
7
7
#Customer intent: As a developer new to Azure deployment, I want to learn how to publish Bicep modules to private module registry.
8
8
---
9
9
10
10
# Quickstart: Publish Bicep modules to private module registry
11
11
12
-
Learn how to publish Bicep modules to private modules registry, and how to call the modules from your Bicep files. Private module registry allows you to share Bicep modules within your organization. To learn more, see [Create private registry for Bicep modules](./private-module-registry.md). To contribute to the public module registry, see the [contribution guide](https://github.com/Azure/bicep-registry-modules/blob/main/CONTRIBUTING.md).
12
+
Learn how to publish Bicep modules to private modules registry, and how to call the modules from your Bicep files. Private module registry allows you to share Bicep modules within your organization. To learn more, see [Create private registry for Bicep modules](./private-module-registry.md).
0 commit comments