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/templates/template-tutorial-create-templates-with-dependent-resources.md
+36-31Lines changed: 36 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
title: Template with dependent resources
3
3
description: Learn how to create an Azure Resource Manager template with multiple resources, and how to deploy it using the Azure portal
4
4
author: mumian
5
-
ms.date: 03/04/2019
5
+
ms.date: 04/10/2020
6
6
ms.topic: tutorial
7
7
ms.author: jgao
8
8
---
9
9
10
10
# Tutorial: Create ARM templates with dependent resources
11
11
12
-
Learn how to create an Azure Resource Manager (ARM) template to deploy multiple resources and configure the deployment order. After you create the template, you deploy the template using the Cloud shell from the Azure portal.
12
+
Learn how to create an Azure Resource Manager (ARM) template to deploy multiple resources and configure the deployment order. After you create the template, you deploy the template using the Cloud Shell from the Azure portal.
13
13
14
14
In this tutorial, you create a storage account, a virtual machine, a virtual network, and some other dependent resources. Some of the resources cannot be deployed until another resource exists. For example, you can't create the virtual machine until its storage account and network interface exist. You define this relationship by making one resource as dependent on the other resources. Resource Manager evaluates the dependencies between resources, and deploys them in their dependent order. When resources aren't dependent on each other, Resource Manager deploys them in parallel. For more information, see [Define the order for deploying resources in ARM templates](./define-resource-dependency.md).
15
15
@@ -34,6 +34,7 @@ To complete this article, you need:
34
34
```console
35
35
openssl rand -base64 32
36
36
```
37
+
37
38
Azure Key Vault is designed to safeguard cryptographic keys and other secrets. For more information, see [Tutorial: Integrate Azure Key Vault in ARM template deployment](./template-tutorial-use-key-vault.md). We also recommend you to update your password every three months.
38
39
39
40
## Open a Quickstart template
@@ -46,6 +47,7 @@ Azure QuickStart Templates is a repository for ARM templates. Instead of creatin
It is helpful to get some basic understanding of the template before customizing it.
76
+
It is helpful to review the template reference before customizing a template.
74
77
75
-
2. Expand the first resource. It is a storage account. Compare the resource definition to the [template reference](https://docs.microsoft.com/azure/templates/Microsoft.Storage/storageAccounts).
78
+
1. Expand the first resource. It is a storage account. Compare the resource definition to the [template reference](/azure/templates/Microsoft.Storage/storageAccounts).
76
79
77
80

78
81
79
-
3. Expand the second resource. The resource type is `Microsoft.Network/publicIPAddresses`. Compare the resource definition to the [template reference](https://docs.microsoft.com/azure/templates/microsoft.network/publicipaddresses).
82
+
1. Expand the second resource. The resource type is `Microsoft.Network/publicIPAddresses`. Compare the resource definition to the [template reference](/azure/templates/microsoft.network/publicipaddresses).
80
83
81
84

82
-
4. Expand the fourth resource. The resource type is `Microsoft.Network/networkInterfaces`:
83
85
84
-

86
+
1. Expand the third resource. The resource type is `Microsoft.Network/networkSecurityGroups`. Compare the resource definition to the [template reference](/azure/templates/microsoft.network/networksecuritygroups).
87
+
88
+

89
+
90
+
1. Expand the fourth resource. The resource type is `Microsoft.Network/virtualNetworks`:
91
+
92
+

93
+
94
+
The dependsOn element enables you to define one resource as a dependent on one or more resources. The dependsOn element enables you to define one resource as a dependent on one or more resources. This resource depends on one other resource:
85
95
86
-
The dependsOn element enables you to define one resource as a dependent on one or more resources. The resource depends on two other resources:
96
+
* `Microsoft.Network/networkSecurityGroups`
97
+
98
+
1. Expand the fifty resource. The resource type is `Microsoft.Network/networkInterfaces`. The resource depends on two other resources:
87
99
88
100
* `Microsoft.Network/publicIPAddresses`
89
101
* `Microsoft.Network/virtualNetworks`
90
102
91
-
5. Expand the fifth resource. This resource is a virtual machine. It depends on two other resources:
103
+
1. Expand the sixth resource. This resource is a virtual machine. It depends on two other resources:
92
104
93
105
* `Microsoft.Storage/storageAccounts`
94
106
* `Microsoft.Network/networkInterfaces`
@@ -101,27 +113,17 @@ By specifying the dependencies, Resource Manager efficiently deploys the solutio
There are many methods for deploying templates. In this tutorial, you use Cloud Shell from the Azure portal.
107
-
108
-
1. Sign in to the [Cloud Shell](https://shell.azure.com).
109
-
1. Select **PowerShell** from the upper left corner of the Cloud shell, and then select **Confirm**. You use PowerShell in this tutorial.
110
-
1. Select **Upload file** from the Cloud shell:
116
+
1. Follow the instructions in [Deploy the template](./template-tutorial-create-templates-with-dependent-resources.md#deploy-the-template) to open the Cloud Shell and upload the revised template.
1. Select the template you saved earlier in the tutorial. The default name is **azuredeploy.json**. If you have a file with the same file name, the old file is overwritten without any notification.
114
-
115
-
You can optionally use the **ls $HOME** command and the **cat $HOME/azuredeploy.json** command to verify the files are uploaded successfully.
116
-
117
-
1. From the Cloud shell, run the following PowerShell commands. To increase security, use a generated password for the virtual machine administrator account. See [Prerequisites](#prerequisites).
118
+
1. Run the following PowerShell script to deploy the template.
118
119
119
120
```azurepowershell
120
-
$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name"
121
+
$projectName = Read-Host -Prompt "Enter a project name that is used to generate resource group name"
121
122
$location = Read-Host -Prompt "Enter the location (i.e. centralus)"
122
123
$adminUsername = Read-Host -Prompt "Enter the virtual machine admin username"
123
124
$adminPassword = Read-Host -Prompt "Enter the admin password" -AsSecureString
124
125
$dnsLabelPrefix = Read-Host -Prompt "Enter the DNS label prefix"
0 commit comments