Skip to content

Commit 380faee

Browse files
authored
Merge pull request #201664 from sheisanchez/0614-add-params
review of third arm template tutorial
2 parents 46d4e04 + 47ff530 commit 380faee

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

articles/azure-resource-manager/templates/template-tutorial-add-parameters.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22
title: Tutorial - add parameters to template
33
description: Add parameters to your Azure Resource Manager template (ARM template) to make it reusable.
44
author: mumian
5-
ms.date: 03/31/2020
5+
ms.date: 06/15/2022
66
ms.topic: tutorial
77
ms.author: jgao
88
ms.custom: devx-track-azurepowershell
99
---
1010

1111
# Tutorial: Add parameters to your ARM template
1212

13-
In the [previous tutorial](template-tutorial-add-resource.md), you learned how to add a storage account to the template and deploy it. In this tutorial, you learn how to improve the Azure Resource Manager template (ARM template) by adding parameters. This tutorial takes about **14 minutes** to complete.
13+
In the [previous tutorial](template-tutorial-add-resource.md), you learned how to add an [Azure storage account](../../storage/common/storage-account-create.md) to the template and deploy it. In this tutorial, you learn how to improve the Azure Resource Manager template (ARM template) by adding parameters. This tutorial takes about **14 minutes** to complete.
1414

1515
## Prerequisites
1616

1717
We recommend that you complete the [tutorial about resources](template-tutorial-add-resource.md), but it's not required.
1818

19-
You must have Visual Studio Code with the Resource Manager Tools extension, and either Azure PowerShell or Azure CLI. For more information, see [template tools](template-tutorial-create-first-template.md#get-tools).
19+
You need to have [Visual Studio Code](https://code.visualstudio.com/) installed and working with the Azure Resource Manager Tools extension, and either Azure PowerShell or Azure CLI. For more information, see [template tools](template-tutorial-create-first-template.md#get-tools).
2020

2121
## Review template
2222

23-
At the end of the previous tutorial, your template had the following JSON:
23+
At the end of the previous tutorial, your template has the following JSON file:
2424

2525
:::code language="json" source="~/resourcemanager-templates/get-started-with-templates/add-storage/azuredeploy.json":::
2626

27-
You may have noticed that there's a problem with this template. The storage account name is hard-coded. You can only use this template to deploy the same storage account every time. To deploy a storage account with a different name, you would have to create a new template, which obviously isn't a practical way to automate your deployments.
27+
You may notice that there's a problem with this template. The storage account name is hard-coded. You can only use this template to deploy the same storage account every time. To deploy a storage account with a different name, you need to create a new template, which obviously isn't a practical way to automate your deployments.
2828

2929
## Make template reusable
3030

31-
To make your template reusable, let's add a parameter that you can use to pass in a storage account name. The highlighted JSON in the following example shows what changed in your template. The `storageName` parameter is identified as a string. The maximum length is set to 24 characters to prevent any names that are too long.
31+
To make your template reusable, let's add a parameter that you can use to pass in a storage account name. The highlighted JSON file in the following example shows the changes in your template. The `storageName` parameter is identified as a string. The storage account name is all lowercase letters or numbers and has a limit of 24 characters.
3232

3333
Copy the whole file and replace your template with its contents.
3434

@@ -38,7 +38,7 @@ Copy the whole file and replace your template with its contents.
3838

3939
Let's deploy the template. The following example deploys the template with Azure CLI or PowerShell. Notice that you provide the storage account name as one of the values in the deployment command. For the storage account name, provide the same name you used in the previous tutorial.
4040

41-
If you haven't created the resource group, see [Create resource group](template-tutorial-create-first-template.md#create-resource-group). The example assumes you've set the `templateFile` variable to the path to the template file, as shown in the [first tutorial](template-tutorial-create-first-template.md#deploy-template).
41+
If you haven't created the resource group, see [Create resource group](template-tutorial-create-first-template.md#create-resource-group). The example assumes you set the `templateFile` variable to the path of the template file, as shown in the [first tutorial](template-tutorial-create-first-template.md#deploy-template).
4242

4343
# [PowerShell](#tab/azure-powershell)
4444

@@ -52,7 +52,7 @@ New-AzResourceGroupDeployment `
5252

5353
# [Azure CLI](#tab/azure-cli)
5454

55-
To run this deployment command, you must have the [latest version](/cli/azure/install-azure-cli) of Azure CLI.
55+
To run this deployment command, you need to have the [latest version](/cli/azure/install-azure-cli) of Azure CLI.
5656

5757
```azurecli
5858
az deployment group create \
@@ -66,25 +66,25 @@ az deployment group create \
6666

6767
## Understand resource updates
6868

69-
In the previous section, you deployed a storage account with the same name that you had created earlier. You may be wondering how the resource is affected by the redeployment.
69+
After you deploy a storage account with the same name you used earlier, you may wonder how the redeployment affects the resource.
7070

71-
If the resource already exists and no change is detected in the properties, no action is taken. If the resource already exists and a property has changed, the resource is updated. If the resource doesn't exist, it's created.
71+
If the resource already exists, and there's no change in the properties, there's no need for further action. If the resource exists and a property changes, it updates. If the resource doesn't exist, it's created.
7272

73-
This way of handling updates means your template can include all of the resources you need for an Azure solution. You can safely redeploy the template and know that resources are changed or created only when needed. For example, if you have added files to your storage account, you can redeploy the storage account without losing those files.
73+
This way of handling updates means your template can include all of the resources you need for an Azure solution. You can safely redeploy the template and know that resources change or are created only when needed. If you add files to your storage account, for example, you can redeploy the storage account without losing the files.
7474

7575
## Customize by environment
7676

77-
Parameters enable you to customize the deployment by providing values that are tailored for a particular environment. For example, you can pass different values based on whether you're deploying to an environment for development, test, and production.
77+
Parameters let you customize the deployment by providing values that tailored for a particular environment. You can pass different values, for example, based on whether you're deploying to a development, testing, or production environment.
7878

79-
The previous template always deployed a **Standard_LRS** storage account. You might want the flexibility to deploy different SKUs depending on the environment. The following example shows the changes to add a parameter for SKU. Copy the whole file and paste over your template.
79+
The previous template always deploys a standard locally redundant storage (LRS) **Standard_LRS** account. You might want the flexibility to deploy different stock keeping units (SKUs) depending on the environment. The following example shows the changes to add a parameter for SKU. Copy the whole file and paste it over your template.
8080

8181
:::code language="json" source="~/resourcemanager-templates/get-started-with-templates/add-sku/azuredeploy.json" range="1-40" highlight="10-23,32":::
8282

83-
The `storageSKU` parameter has a default value. This value is used when a value isn't specified during the deployment. It also has a list of allowed values. These values match the values that are needed to create a storage account. You don't want users of your template to pass in SKUs that don't work.
83+
The `storageSKU` parameter has a default value. Use this value when the deployment doesn't specify it. It also has a list of allowed values. These values match the values that are needed to create a storage account. You want your template users to pass SKUs that work.
8484

8585
## Redeploy template
8686

87-
You're ready to deploy again. Because the default SKU is set to **Standard_LRS**, you don't need to provide a value for that parameter.
87+
You're ready to deploy again. Because the default SKU is set to **Standard_LRS**, you've already provided a parameter value.
8888

8989
# [PowerShell](#tab/azure-powershell)
9090

@@ -109,9 +109,9 @@ az deployment group create \
109109
---
110110

111111
> [!NOTE]
112-
> If the deployment failed, use the `verbose` switch to get information about the resources being created. Use the `debug` switch to get more information for debugging.
112+
> If the deployment fails, use the `verbose` switch to get information about the resources being created. Use the `debug` switch to get more information for debugging.
113113
114-
To see the flexibility of your template, let's deploy again. This time set the SKU parameter to **Standard_GRS**. You can either pass in a new name to create a different storage account, or use the same name to update your existing storage account. Both options work.
114+
To see the flexibility of your template, let's deploy it again. This time set the SKU parameter to standard geo-redundant storage (GRS) **Standard_GRS**. You can either pass in a new name to create a different storage account or use the same name to update your existing storage account. Both options work.
115115

116116
# [PowerShell](#tab/azure-powershell)
117117

@@ -136,7 +136,7 @@ az deployment group create \
136136

137137
---
138138

139-
Finally, let's run one more test and see what happens when you pass in a SKU that isn't one of the allowed values. In this case, we test the scenario where a user of your template thinks **basic** is one of the SKUs.
139+
Finally, let's run one more test and see what happens when you pass in an SKU that isn't one of the allowed values. In this case, we test the scenario where your template user thinks **basic** is one of the SKUs.
140140

141141
# [PowerShell](#tab/azure-powershell)
142142

@@ -161,22 +161,22 @@ az deployment group create \
161161

162162
---
163163

164-
The command fails immediately with an error message that states which values are allowed. Resource Manager identifies the error before the deployment starts.
164+
The command fails at once with an error message that gives the allowed values. The ARM processor finds the error before the deployment starts.
165165

166166
## Clean up resources
167167

168168
If you're moving on to the next tutorial, you don't need to delete the resource group.
169169

170-
If you're stopping now, you might want to clean up the resources you deployed by deleting the resource group.
170+
If you're stopping now, you might want to clean up your deployed resources by deleting the resource group.
171171

172172
1. From the Azure portal, select **Resource group** from the left menu.
173-
2. Enter the resource group name in the **Filter by name** field.
174-
3. Select the resource group name.
173+
2. Type the resource group name in the **Filter for any field ...** text field.
174+
3. Check the box next to myResourceGroup and select **myResourceGroup** or your resource group name.
175175
4. Select **Delete resource group** from the top menu.
176176

177177
## Next steps
178178

179-
You improved the template created in the [first tutorial](template-tutorial-create-first-template.md) by adding parameters. In the next tutorial, you'll learn about template functions.
179+
You improved the template you created in the [first tutorial](template-tutorial-create-first-template.md) by adding parameters. In the next tutorial, you learn about template functions.
180180

181181
> [!div class="nextstepaction"]
182182
> [Add template functions](template-tutorial-add-functions.md)

0 commit comments

Comments
 (0)