Skip to content

Commit f7e5dcc

Browse files
authored
Merge pull request #126579 from picccard/patch-2
change bicep module name to not be mandatory
2 parents 304e8ec + c11d0ee commit f7e5dcc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ Use the symbolic name to reference the module in another part of the Bicep file.
6565

6666
The path can be either a local file or a file in a registry. The local file can be either a Bicep file or an ARM template for JSON. For more information, see [Path to a module](#path-to-a-module).
6767

68-
The `name` property is required. It becomes the name of the nested deployment resource in the generated template.
68+
The `name` property is optional. It becomes the name of the nested deployment resource in the generated template. If no name is provided, a GUID will be generated as the name for the nested deployment resource.
6969

70-
If a module with a static name is deployed concurrently to the same scope, there's the potential for one deployment to interfere with the output from the other deployment. For example, if two Bicep files use the same module with the same static name (`examplemodule`) and are targeted to the same resource group, one deployment might show the wrong output. If you're concerned about concurrent deployments to the same scope, give your module a unique name.
70+
If a module with a static name is deployed concurrently to the same scope, there's the potential for one deployment to interfere with the output from the other deployment. For example, if two Bicep files use the same module with the same static name (`examplemodule`) and are targeted to the same resource group, one deployment might show the wrong output. If you're concerned about concurrent deployments to the same scope, give your module a unique name. Another way to ensure unique module names is to leave out the `name` property, an unique module name will be generated automatically.
7171

7272
The following example concatenates the deployment name to the module name. If you provide a unique name for the deployment, the module name is also unique.
7373

@@ -78,6 +78,14 @@ module stgModule 'storageAccount.bicep' = {
7878
}
7979
```
8080

81+
Not providing any module name is also valid. A GUID will be generate as the module name.
82+
83+
```bicep
84+
module stgModule 'storageAccount.bicep' = {
85+
scope: resourceGroup('demoRG')
86+
}
87+
```
88+
8189
If you need to *specify a scope* that's different than the scope for the main file, add the scope property. For more information, see [Set module scope](#set-module-scope).
8290

8391
```bicep

0 commit comments

Comments
 (0)