Skip to content

Commit a48ddd2

Browse files
authored
Merge pull request #208772 from sheisanchez/0822-use-parameter-file
first round of edits for use parameter file
2 parents 14f9b13 + d61faab commit a48ddd2

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

articles/azure-resource-manager/templates/template-tutorial-use-parameter-file.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Tutorial - use parameter file to deploy template
33
description: Use parameter files that contain the values to use for deploying your Azure Resource Manager template (ARM template).
44
author: mumian
5-
ms.date: 09/10/2020
5+
ms.date: 08/22/2022
66
ms.topic: tutorial
77
ms.author: jgao
88
ms.custom: devx-track-azurepowershell
@@ -11,33 +11,33 @@ ms.custom: devx-track-azurepowershell
1111

1212
# Tutorial: Use parameter files to deploy your ARM template
1313

14-
In this tutorial, you learn how to use [parameter files](parameter-files.md) to store the values you pass in during deployment. In the previous tutorials, you used inline parameters with your deployment command. This approach worked for testing your Azure Resource Manager template (ARM template), but when automating deployments it can be easier to pass a set of values for your environment. Parameter files make it easier to package parameter values for a specific environment. In this tutorial, you'll create parameter files for development and production environments. It takes about **12 minutes** to complete.
14+
In this tutorial, you learn how to use [parameter files](parameter-files.md) to store the values you pass in during deployment. In the previous tutorials, you used inline parameters with your deployment command. This approach worked for testing your Azure Resource Manager template (ARM template), but when automating deployments it can be easier to pass a set of values for your environment. Parameter files make it easier to package parameter values for a specific environment. In this tutorial, you create parameter files for development and production environments. This instruction takes **12 minutes** to complete.
1515

1616
## Prerequisites
1717

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

20-
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).
20+
You need to have Visual Studio Code with the Resource Manager Tools extension, and either Azure PowerShell or Azure Command-Line Interface (CLI). For more information, see [template tools](template-tutorial-create-first-template.md#get-tools).
2121

2222
## Review template
2323

24-
Your template has many parameters you can provide during deployment. At the end of the previous tutorial, your template looked like:
24+
Your template has many parameters you can provide during deployment. At the end of the previous tutorial, your template had the following JSON file:
2525

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

2828
This template works well, but now you want to easily manage the parameters that you pass in for the template.
2929

3030
## Add parameter files
3131

32-
Parameter files are JSON files with a structure that is similar to your template. In the file, you provide the parameter values you want to pass in during deployment.
32+
Parameter files are JSON files with a structure that's similar to your template. In the file, you provide the parameter values you want to pass in during deployment.
3333

34-
Within the parameter file, you provide values for the parameters in your template. The name of each parameter in your parameter file must match the name of a parameter in your template. The name is case-insensitive but to easily see the matching values we recommend that you match the casing from the template.
34+
Within the parameter file, you provide values for the parameters in your template. The name of each parameter in your parameter file needs to match the name of a parameter in your template. The name is case-insensitive but to easily see the matching values we recommend that you match the casing from the template.
3535

3636
You don't have to provide a value for every parameter. If an unspecified parameter has a default value, that value is used during deployment. If a parameter doesn't have a default value and isn't specified in the parameter file, you're prompted to provide a value during deployment.
3737

38-
You can't specify a parameter name in your parameter file that doesn't match a parameter name in the template. You get an error when unknown parameters are provided.
38+
You can't specify a parameter name in your parameter file that doesn't match a parameter name in the template. You get an error when you provide unknown parameters.
3939

40-
In Visual Studio Code, create a new file with following content. Save the file with the name _azuredeploy.parameters.dev.json_.
40+
In Visual Studio Code, create a new file with the following content. Save the file with the name _azuredeploy.parameters.dev.json_.
4141

4242
:::code language="json" source="~/resourcemanager-templates/get-started-with-templates/add-tags/azuredeploy.parameters.dev.json":::
4343

@@ -47,7 +47,7 @@ Again, create a new file with the following content. Save the file with the name
4747

4848
:::code language="json" source="~/resourcemanager-templates/get-started-with-templates/add-tags/azuredeploy.parameters.prod.json":::
4949

50-
This file is your parameter file for the production environment. Notice that it uses **Standard_GRS** for the storage account, names resources with a **contoso** prefix, and sets the `Environment` tag to **Production**. In a real production environment, you would also want to use an app service with a SKU other than free, but we'll continue to use that SKU for this tutorial.
50+
This file is your parameter file for the production environment. Notice that it uses **Standard_GRS** for the storage account, names resources with a **contoso** prefix, and sets the `Environment` tag to **Production**. In a real production environment, you would also want to use an app service with a SKU other than free, but we use that SKU for this tutorial.
5151

5252
## Deploy template
5353

@@ -57,7 +57,7 @@ As a final test of your template, let's create two new resource groups. One for
5757

5858
For the template and parameter variables, replace `{path-to-the-template-file}`, `{path-to-azuredeploy.parameters.dev.json}`, `{path-to-azuredeploy.parameters.prod.json}`, and the curly braces `{}` with your template and parameter file paths.
5959

60-
First, we'll deploy to the dev environment.
60+
First, let's deploy to the dev environment.
6161

6262
# [PowerShell](#tab/azure-powershell)
6363

@@ -76,7 +76,7 @@ New-AzResourceGroupDeployment `
7676

7777
# [Azure CLI](#tab/azure-cli)
7878

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

8181
```azurecli
8282
templateFile="{path-to-the-template-file}"
@@ -93,7 +93,7 @@ az deployment group create \
9393

9494
---
9595

96-
Now, we'll deploy to the production environment.
96+
Now, we deploy to the production environment.
9797

9898
# [PowerShell](#tab/azure-powershell)
9999

@@ -126,27 +126,31 @@ az deployment group create \
126126
---
127127

128128
> [!NOTE]
129-
> 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.
129+
> If the deployment fails, use the `verbose` switch to get information about the resources you're creating. Use the `debug` switch to get more information for debugging.
130130
131131
## Verify deployment
132132

133133
You can verify the deployment by exploring the resource groups from the Azure portal.
134134

135135
1. Sign in to the [Azure portal](https://portal.azure.com).
136136
1. From the left menu, select **Resource groups**.
137-
1. You see the two new resource groups you deployed in this tutorial.
137+
1. You see the two new resource groups you deploy in this tutorial.
138138
1. Select either resource group and view the deployed resources. Notice that they match the values you specified in your parameter file for that environment.
139139

140140
## Clean up resources
141141

142-
1. From the Azure portal, select **Resource group** from the left menu.
143-
2. Enter the resource group name in the **Filter by name** field. If you've completed this series, you have three resource groups to delete - **myResourceGroup**, **myResourceGroupDev**, and **myResourceGroupProd**.
144-
3. Select the resource group name.
145-
4. Select **Delete resource group** from the top menu.
142+
1. From the Azure portal, select **Resource groups** from the left menu.
143+
1. Select the hyperlinked resource group name next to the check box. If you complete this series, you have three resource groups to delete - **myResourceGroup**, **myResourceGroupDev**, and **myResourceGroupProd**.
144+
1. Select the **Delete resource group** icon from the top menu.
145+
146+
> [!CAUTION]
147+
> Deleting a resource group is irreversible.
148+
149+
1. Type the resource group name in the pop-up window that displays and select **Delete**.
146150

147151
## Next steps
148152

149-
Congratulations, you've finished this introduction to deploying templates to Azure. Let us know if you have any comments and suggestions in the feedback section. Thanks!
153+
Congratulations. You've finished this introduction to deploying templates to Azure. Let us know if you have any comments and suggestions in the feedback section.
150154

151155
The next tutorial series goes into more detail about deploying templates.
152156

0 commit comments

Comments
 (0)