Skip to content

Commit 15b2ee5

Browse files
authored
Merge pull request #157932 from davidsmatlak/ds-rb-templates-0507
Removes Bicep content and code samples (PR 1)
2 parents 97e0a72 + 453aa59 commit 15b2ee5

13 files changed

+63
-646
lines changed

articles/azure-resource-manager/templates/add-resource-extensions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Post-deployment configuration by using extensions (Bicep)
3-
description: Learn how to use Azure Resource Manager template (ARM template) extensions to provide post-deployment configurations. (Bicep)
2+
title: Post-deployment configuration with extensions
3+
description: Learn how to use Azure Resource Manager template (ARM template) extensions for post-deployment configurations.
44
author: mumian
55
ms.topic: conceptual
66
ms.date: 12/14/2018
77
ms.author: jgao
88
---
99

10-
# Provide post-deployment configurations by using extensions (Bicep)
10+
# Post-deployment configurations by using extensions
1111

1212
Azure Resource Manager template (ARM template) extensions are small applications that provide post-deployment configuration and automation tasks on Azure resources. The most popular one is virtual machine extensions. See [Virtual machine extensions and features for Windows](../../virtual-machines/extensions/features-windows.md), and [Virtual machine extensions and features for Linux](../../virtual-machines/extensions/features-linux.md).
1313

articles/azure-resource-manager/templates/child-resource-name-type.md

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Child resources in templates
33
description: Describes how to set the name and type for child resources in an Azure Resource Manager template (ARM template).
44
ms.topic: conceptual
5-
ms.date: 04/23/2021
5+
ms.date: 05/07/2021
66
---
77

88
# Set name and type for child resources
@@ -11,16 +11,12 @@ Child resources are resources that exist only within the context of another reso
1111

1212
Each parent resource accepts only certain resource types as child resources. The resource type for the child resource includes the resource type for the parent resource. For example, `Microsoft.Web/sites/config` and `Microsoft.Web/sites/extensions` are both child resources of the `Microsoft.Web/sites`. The accepted resource types are specified in the [template schema](https://github.com/Azure/azure-resource-manager-schemas) of the parent resource.
1313

14-
[!INCLUDE [Bicep preview](../../../includes/resource-manager-bicep-preview.md)]
15-
1614
In an Azure Resource Manager template (ARM template), you can specify the child resource either within the parent resource or outside of the parent resource. The values you provide for the resource name and resource type vary based on whether the child resource is defined inside or outside of the parent resource.
1715

1816
## Within parent resource
1917

2018
The following example shows the child resource included within the resources property of the parent resource.
2119

22-
# [JSON](#tab/json)
23-
2420
```json
2521
"resources": [
2622
{
@@ -78,65 +74,10 @@ The full resource type is still `Microsoft.Network/virtualNetworks/subnets`. You
7874

7975
The child resource name is set to **Subnet1** but the full name includes the parent name. You don't provide **VNet1** because it's assumed from the parent resource.
8076

81-
# [Bicep](#tab/bicep)
82-
83-
```bicep
84-
resource <parent-resource-symbolic-name> '<resource-type>@<api-version>' = {
85-
<parent-resource-properties>
86-
87-
resource <child-resource-symbolic-name> '<child-resource-type>' = {
88-
<child-resource-properties>
89-
}
90-
}
91-
```
92-
93-
A nested resource declaration must appear at the top level of syntax of the parent resource. Declarations may be nested arbitrarily deep, as long as each level is a child type of its parent resource.
94-
95-
When defined within the parent resource type, you format the type and name values as a single segment without slashes. The following example shows a virtual network and with a subnet. Notice that the subnet is included within the resources array for the virtual network. The name is set to **Subnet1** and the type is set to **subnets**.
96-
97-
```bicep
98-
param location string
99-
100-
resource VNet1 'Microsoft.Network/virtualNetworks@2018-10-01' = {
101-
name: 'VNet1'
102-
location: location
103-
properties: {
104-
addressSpace: {
105-
addressPrefixes: [
106-
'10.0.0.0/16'
107-
]
108-
}
109-
}
110-
111-
resource VNet1_Subnet1 'subnets' = {
112-
name: 'Subnet1'
113-
properties: {
114-
addressPrefix: '10.0.0.0/24'
115-
}
116-
}
117-
}
118-
```
119-
120-
The full resource type is still `Microsoft.Network/virtualNetworks/subnets`. You don't provide `Microsoft.Network/virtualNetworks/` because it's assumed from the parent resource type and version. The nested resource may optionally declare an API version using the syntax `<segment>@<version>`. If the nested resource omits the API version, the API version of the parent resource is used. If the nested resource specifies an API version, the API version specified is used.
121-
122-
The child resource name is set to **Subnet1** but the full name includes the parent name. You don't provide VNet1 because it's assumed from the parent resource.
123-
124-
To access the child resource symbolic name, you need to use the `::` operator. For example, to output a property from a child resource:
125-
126-
```bicep
127-
output childAddressPrefix string = VNet1::VNet1_Subnet1.properties.addressPrefix
128-
```
129-
130-
A nested resource can access properties of its parent resource. Other resources declared inside the body of the same parent resource can reference each other and the typical rules about cyclic-dependencies apply. A parent resource may not access properties of the resources it contains, this would cause a cyclic-dependency.
131-
132-
---
133-
13477
## Outside parent resource
13578

13679
The following example shows the child resource outside of the parent resource. You might use this approach if the parent resource isn't deployed in the same template, or if want to use [copy](copy-resources.md) to create more than one child resource.
13780

138-
# [JSON](#tab/json)
139-
14081
```json
14182
"resources": [
14283
{
@@ -186,47 +127,6 @@ The following example shows a virtual network and subnet that are both defined a
186127
]
187128
```
188129

189-
# [Bicep](#tab/bicep)
190-
191-
```bicep
192-
resource <parent-resource-symbolic-name> '<resource-type>@<api-version>' = {
193-
<parent-resource-properties>
194-
}
195-
196-
resource <child-resource-symbolic-name> '<child-resource-type>@<api-version>' = {
197-
<child-resource-properties>
198-
}
199-
```
200-
201-
When defined outside of the parent resource, you format the type and with slashes to include the parent type and name.
202-
203-
The following example shows a virtual network and subnet that are both defined at the root level. Notice that the subnet isn't included within the resources array for the virtual network. The name is set to **VNet1/Subnet1** and the type is set to `Microsoft.Network/virtualNetworks/subnets`. The child resource is marked as dependent on the parent resource because the parent resource must exist before the child resource can be deployed.
204-
205-
```bicep
206-
param location string
207-
208-
resource VNet1 'Microsoft.Network/virtualNetworks@2018-10-01' = {
209-
name: 'VNet1'
210-
location: location
211-
properties: {
212-
addressSpace: {
213-
addressPrefixes: [
214-
'10.0.0.0/16'
215-
]
216-
}
217-
}
218-
}
219-
220-
resource VNet1_Subnet1 'Microsoft.Network/virtualNetworks/subnets@2018-10-01' = {
221-
name: '${VNet1.name}/Subnet1'
222-
properties: {
223-
addressPrefix: '10.0.0.0/24'
224-
}
225-
}
226-
```
227-
228-
---
229-
230130
## Next steps
231131

232132
* To learn about creating ARM templates, see [Understand the structure and syntax of ARM templates](template-syntax.md).

articles/azure-resource-manager/templates/conditional-resource-deployment.md

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: Conditional deployment with templates
33
description: Describes how to conditionally deploy a resource in an Azure Resource Manager template (ARM template).
44
ms.topic: conceptual
5-
ms.date: 03/02/2021
5+
ms.date: 05/07/2021
66
---
77

88
# Conditional deployment in ARM templates
99

10-
Sometimes you need to optionally deploy a resource in an Azure Resource Manager template (ARM template) or Bicep file. For JSON templates, use the `condition` element to specify whether the resource is deployed. For Bicep, use the `if` keyword to specify whether the resource is deployed. The value for the condition resolves to true or false. When the value is true, the resource is created. When the value is false, the resource isn't created. The value can only be applied to the whole resource.
10+
Sometimes you need to optionally deploy a resource in an Azure Resource Manager template (ARM template). Use the `condition` element to specify whether the resource is deployed. The value for the condition resolves to true or false. When the value is true, the resource is created. When the value is false, the resource isn't created. The value can only be applied to the whole resource.
1111

1212
> [!NOTE]
1313
> Conditional deployment doesn't cascade to [child resources](child-resource-name-type.md). If you want to conditionally deploy a resource and its child resources, you must apply the same condition to each resource type.
@@ -16,8 +16,6 @@ Sometimes you need to optionally deploy a resource in an Azure Resource Manager
1616

1717
You can pass in a parameter value that indicates whether a resource is deployed. The following example conditionally deploys a DNS zone.
1818

19-
# [JSON](#tab/json)
20-
2119
```json
2220
{
2321
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
@@ -40,27 +38,12 @@ You can pass in a parameter value that indicates whether a resource is deployed.
4038
}
4139
```
4240

43-
# [Bicep](#tab/bicep)
44-
45-
```bicep
46-
param deployZone bool
47-
48-
resource dnsZone 'Microsoft.Network/dnszones@2018-05-01' = if (deployZone) {
49-
name: 'myZone'
50-
location: 'global'
51-
}
52-
```
53-
54-
---
55-
56-
For a more complex example, see [Azure SQL logical server](https://github.com/Azure/azure-quickstart-templates/tree/master/101-sql-logical-server).
41+
For a more complex example, see [Azure SQL logical server](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.sql/sql-logical-server).
5742

5843
## New or existing resource
5944

6045
You can use conditional deployment to create a new resource or use an existing one. The following example shows how to either deploy a new storage account or use an existing storage account.
6146

62-
# [JSON](#tab/json)
63-
6447
```json
6548
{
6649
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
@@ -103,37 +86,9 @@ You can use conditional deployment to create a new resource or use an existing o
10386
}
10487
```
10588

106-
# [Bicep](#tab/bicep)
107-
108-
```bicep
109-
param storageAccountName string
110-
param location string = resourceGroup().location
111-
112-
@allowed([
113-
'new'
114-
'existing'
115-
])
116-
param newOrExisting string = 'new'
117-
118-
resource sa 'Microsoft.Storage/storageAccounts@2019-06-01' = if (newOrExisting == 'new') {
119-
name: storageAccountName
120-
location: location
121-
sku: {
122-
name: 'Standard_LRS'
123-
tier: 'Standard'
124-
}
125-
kind: 'StorageV2'
126-
properties: {
127-
accessTier: 'Hot'
128-
}
129-
}
130-
```
131-
132-
---
133-
13489
When the parameter `newOrExisting` is set to **new**, the condition evaluates to true. The storage account is deployed. However, when `newOrExisting` is set to **existing**, the condition evaluates to false and the storage account isn't deployed.
13590

136-
For a complete example template that uses the `condition` element, see [VM with a new or existing Virtual Network, Storage, and Public IP](https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-new-or-existing-conditions).
91+
For a complete example template that uses the `condition` element, see [VM with a new or existing Virtual Network, Storage, and Public IP](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.compute/vm-new-or-existing-conditions).
13792

13893
## Runtime functions
13994

articles/azure-resource-manager/templates/copy-outputs.md

Lines changed: 2 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
title: Define multiple instances of an output value
33
description: Use copy operation in an Azure Resource Manager template (ARM template) to iterate multiple times when returning a value from a deployment.
44
ms.topic: conceptual
5-
ms.date: 04/01/2021
5+
ms.date: 05/07/2021
66
---
7+
78
# Output iteration in ARM templates
89

910
This article shows you how to create more than one value for an output in your Azure Resource Manager template (ARM template). By adding copy loop to the outputs section of your template, you can dynamically return a number of items during deployment.
@@ -12,8 +13,6 @@ You can also use copy loop with [resources](copy-resources.md), [properties in a
1213

1314
## Syntax
1415

15-
# [JSON](#tab/json)
16-
1716
Add the `copy` element to the output section of your template to return a number of items. The copy element has the following general format:
1817

1918
```json
@@ -27,37 +26,6 @@ The `count` property specifies the number of iterations you want for the output
2726

2827
The `input` property specifies the properties that you want to repeat. You create an array of elements constructed from the value in the `input` property. It can be a single property (like a string), or an object with several properties.
2928

30-
# [Bicep](#tab/bicep)
31-
32-
Loops can be used to return a number of items during deployment:
33-
34-
- Iterating over an array:
35-
36-
```bicep
37-
output <output-name> array = [for <item> in <collection>: {
38-
<properties>
39-
}]
40-
41-
```
42-
43-
- Iterating over the elements of an array
44-
45-
```bicep
46-
output <output-name> array = [for <item>, <index> in <collection>: {
47-
<properties>
48-
}]
49-
```
50-
51-
- Using loop index
52-
53-
```bicep
54-
output <output-name> array = [for <index> in range(<start>, <stop>): {
55-
<properties>
56-
}]
57-
```
58-
59-
---
60-
6129
## Copy limits
6230

6331
The count can't exceed 800.
@@ -75,8 +43,6 @@ Earlier versions of PowerShell, CLI, and the REST API don't support zero for cou
7543

7644
The following example creates a variable number of storage accounts and returns an endpoint for each storage account:
7745

78-
# [JSON](#tab/json)
79-
8046
```json
8147
{
8248
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
@@ -119,28 +85,6 @@ The following example creates a variable number of storage accounts and returns
11985
}
12086
```
12187

122-
# [Bicep](#tab/bicep)
123-
124-
```bicep
125-
param storageCount int = 2
126-
127-
var baseName_var = 'storage${uniqueString(resourceGroup().id)}'
128-
129-
resource baseName 'Microsoft.Storage/storageAccounts@2019-04-01' = [for i in range(0, storageCount): {
130-
name: '${i}${baseName_var}'
131-
location: resourceGroup().location
132-
sku: {
133-
name: 'Standard_LRS'
134-
}
135-
kind: 'Storage'
136-
properties: {}
137-
}]
138-
139-
output storageEndpoints array = [for i in range(0, storageCount): reference(${i}${baseName_var}).primaryEndpoints.blob]
140-
```
141-
142-
---
143-
14488
The preceding template returns an array with the following values:
14589

14690
```json
@@ -152,8 +96,6 @@ The preceding template returns an array with the following values:
15296

15397
The next example returns three properties from the new storage accounts.
15498

155-
# [JSON](#tab/json)
156-
15799
```json
158100
{
159101
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
@@ -200,32 +142,6 @@ The next example returns three properties from the new storage accounts.
200142
}
201143
```
202144

203-
# [Bicep](#tab/bicep)
204-
205-
```bicep
206-
param storageCount int = 2
207-
208-
var baseName_var = 'storage${uniqueString(resourceGroup().id)}'
209-
210-
resource baseName 'Microsoft.Storage/storageAccounts@2019-04-01' = [for i in range(0, storageCount): {
211-
name: '${i}${baseName_var}'
212-
location: resourceGroup().location
213-
sku: {
214-
name: 'Standard_LRS'
215-
}
216-
kind: 'Storage'
217-
properties: {}
218-
}]
219-
220-
output storageInfo array = [for i in range(0, storageCount): {
221-
id: reference(concat(i, baseName_var), '2019-04-01', 'Full').resourceId
222-
blobEndpoint: reference(concat(i, baseName_var)).primaryEndpoints.blob
223-
status: reference(concat(i, baseName_var)).statusOfPrimary
224-
}]
225-
```
226-
227-
---
228-
229145
The preceding example returns an array with the following values:
230146

231147
```json

0 commit comments

Comments
 (0)