Skip to content

Commit 0d1a52b

Browse files
committed
edit
1 parent d91d65d commit 0d1a52b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

articles/azure-resource-manager/bicep/linter-rule-no-deployments-resources.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use the following value in the [Bicep configuration file](bicep-config-linter.md
1818

1919
## Solution
2020

21-
In ARM templates, you have the capability to reuse or modularize a template through nesting or linking templates using the `Microsoft.Resources/deployments` resource. Below is an illustration of a nested template:
21+
In ARM templates, you can reuse or modularize a template through nesting or linking templates using the `Microsoft.Resources/deployments` resource. For more information, see [Using linked and nested templates when deploying Azure resources](../templates/linked-templates.md) The following ARM template is a sample of a nested template:
2222

2323
```json
2424
{
@@ -63,7 +63,7 @@ In ARM templates, you have the capability to reuse or modularize a template thro
6363
}
6464
```
6565

66-
In Bicep, you can still use the `Microsoft.Resources/deployments` resource for nesting ARM templates or linking external ARM templates. But, it's not a great idea because it can lead to unsafe and tricky behaviors due to how it's evaluated multiple times. Also, there's hardly any validation and self completion from the Visual Studio Code editor, making it tough to work with. The following Bicep file fails this test because the template contains `Microsoft.Resources/deployments` resource on the root level.
66+
In Bicep, you can still use the `Microsoft.Resources/deployments` resource for nesting ARM templates or linking external ARM templates. But, it's not a great idea because it can lead to unsafe and tricky behaviors due to how it's evaluated multiple times. Also, there's hardly any validation and self completion from Visual Studio Code when you author the Bicep file, making it tough to work with. The following Bicep file fails this test because the template contains `Microsoft.Resources/deployments` resource on the root level.
6767

6868
```bicep
6969
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
@@ -95,7 +95,7 @@ resource nestedTemplate1 'Microsoft.Resources/deployments@2023-07-01' = {
9595

9696
To fix the issue, you can use the Bicep CLI [decompile](./bicep-cli.md#decompile) command. For example, the preceding ARM template can be decomplied into the following Bicep files:
9797

98-
main.bicep:
98+
_main.bicep_:
9999

100100
```bicep
101101
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
@@ -110,7 +110,7 @@ module nestedTemplate1 './nested_nestedTemplate1.bicep' = {
110110
}
111111
```
112112

113-
nested_nestedTemplate1.bicep:
113+
_nested_nestedTemplate1.bicep_:
114114

115115
```bicep
116116
param storageAccountName string
@@ -124,11 +124,11 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
124124
}
125125
kind: 'StorageV2'
126126
}
127-
```
127+
```
128128

129-
Additionally, you can also refence the nested json template using the [module](./modules.md) statement.
129+
Additionally, you can also refence ARM templates using the [module](./modules.md) statement.
130130

131-
main.bicep:
131+
_main.bicep_:
132132

133133
```bicep
134134
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
@@ -141,9 +141,9 @@ module nestedTemplate1 './createStorage.json' = {
141141
location: location
142142
}
143143
}
144-
```bicep
144+
```
145145

146-
createStorage.json
146+
_createStorage.json_:
147147

148148
```json
149149
{

0 commit comments

Comments
 (0)