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/deployment-tutorial-linked-template.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,9 @@ The following PowerShell script creates a storage account, creates a container,
38
38
39
39
Select **Try-it** to open the Cloud shell, select **Copy** to copy the PowerShell script, and right-click the shell pane to paste the script:
40
40
41
+
> [!IMPORTANT]
42
+
> Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. The name must be unique. In the template, the storage account name is the project name with "store" appended, and the project name must be between 3 and 11 characters. So the project name must meet the storage account name requirements and has less than 11 characters.
43
+
41
44
```azurepowershell-interactive
42
45
$projectName = Read-Host -Prompt "Enter a project name:" # This name is used to generate names for Azure resources, such as storage account name.
43
46
$location = Read-Host -Prompt "Enter a location (i.e. centralus)"
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/templates/deployment-tutorial-pipeline.md
+34-42Lines changed: 34 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ If you are already familiar with GitHub and DevOps, you can skip to [Create a pi
17
17
18
18
> [!NOTE]
19
19
> Pick a project name. When you go through the tutorial, replace any of the **AzureRmPipeline** with your project name.
20
+
> This project name is used to generate resource names. One of the resource is a storage account. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. The name must be unique. In the template, the storage account name is the project name with "store" appended, and the project name must be between 3 and 11 characters. So the project name must meet the storage account name requirements and has less than 11 characters.
20
21
21
22
This tutorial covers the following tasks:
22
23
@@ -37,7 +38,7 @@ To complete this article, you need:
37
38
***A GitHub account**, where you use it to create a repository for your templates. If you don’t have one, you can [create one for free](https://github.com). For more information about using GitHub repositories, see [Build GitHub repositories](/azure/devops/pipelines/repos/github).
38
39
***Install Git**. This tutorial instruction uses *Git Bash* or *Git Shell*. For instructions, see [Install Git](https://www.atlassian.com/git/tutorials/install-git).
39
40
***An Azure DevOps organization**. If you don't have one, you can create one for free. See [Create an organization or project collection](https://docs.microsoft.com/azure/devops/organizations/accounts/create-organization?view=azure-devops).
40
-
* Visual Studio Code with Resource Manager Tools extension. See [Use Visual Studio Code to create Azure Resource Manager templates](use-vs-code-to-create-template.md).
41
+
*(optional) **Visual Studio Code with Resource Manager Tools extension**. See [Use Visual Studio Code to create Azure Resource Manager templates](use-vs-code-to-create-template.md).
41
42
42
43
## Prepare a GitHub repository
43
44
@@ -50,7 +51,7 @@ If you don’t have a GitHub account, see [Prerequisites](#prerequisites).
50
51
1. Sign in to [GitHub](https://github.com).
51
52
1. Select your account image on the upper right corner, and then select **Your repositories**.
1. In **Repository name**, enter a repository name. For example, **AzureRmPipeline-repo**. Remember to replace any of **AzureRmPipeline** with your project name. You can select either **Public** or **private** for going through this tutorial. And then select **Create repository**.
@@ -120,7 +121,7 @@ A DevOps organization is needed before you can proceed to the next procedure. I
120
121
1. Sign in to [Azure DevOps](https://dev.azure.com).
1. Select **New project**. If you don't have any projects, the create project page is opened automatically.
126
127
1. Enter the following values:
@@ -159,50 +160,42 @@ To create a pipeline with a step to deploy a template:
159
160
1. Select **New pipeline**.
160
161
1. From the **Connect** tab, select **GitHub**. If asked, enter your GitHub credentials, and then follow the instructions. If you see the following screen, select **Only select repositories**, and verify your repository is in the list before you select **Approve & Install**.
161
162
162
-

163
+

163
164
164
165
1. From the **Select** tab, select your repository. The default name is **[YourAccountName]/[YourGitHubRepositoryName]**.
165
166
1. From the **Configure** tab, select **Starter pipeline**. It shows the **azure-pipelines.yml** pipeline file with two script steps.
166
-
1. Replace the **steps** section with the following YAML:
1. Select **Show assistant** on the right of the screen to open **Tasks** pane.
170
+
1. Select **ARM template deployment**.
171
+
1. Enter the following values:
183
172
184
-
It shall look like:
173
+
* **deploymentScope**: Select **Resource Group**.. To learn more about the scopes, see [Deployment scopes](deploy-rest.md#deployment-scope).
174
+
* **Azure Resource Manager connection**: Select the service connection name that you created earlier.
175
+
* **Subscription**: Specify the target subscription ID.
176
+
* **Action**: Select the **Create Or Update Resource Group** action does 2 actions - 1. create a resource group if a new resource group name is provided; 2. deploy the template specified.
177
+
* **Resource group**: Enter a new resource group name. For example, **AzureRmPipeline-rg**.
178
+
* **Location**: Select a location for the resource group, for example, **Central US**.
179
+
* **Template location**: Select **Linked artifact**, which means the task looks for the template file directly from the connected repository.
180
+
* **Template**: Enter **CreateWebApp/azuredeploy.json**. If you changed the folder name and the file name, you need to change this value.
181
+
* **Template parameters**: Leave this field blank. You will specify the parameter values in the **Override template parameters.
182
+
* **overrideParameters**: Enter **-projectName [EnterAProjectName] -linkedTemplateUri [EnterTheLinkedTemplateURL]**. Replace the project name ans the linked template url. The linked template URL is what you wrote down at the end of [Create a Github repository](#create-a-github-repository).
183
+
* **Deployment mode**: Select **Incremental**.
184
+
* **Deployment name**: Enter **DeployPipelineTemplate**. Select **Advanced** before you can see **Deployment name**.
For more information about the task, see [Azure Resource Group Deployment task](/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment), and [Azure Resource Manager template deployment task](https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureResourceManagerTemplateDeploymentV3/README.md)
187
189
188
-
Make the following changes:
190
+
The yml file shall be similar to:
189
191
190
-
* **deploymentScope**: Select the scope of deployment from the options: `Management Group`, `Subscription` and `Resource Group`. Use **Resource Group** in this tutorial. To learn more about the scopes, see [Deployment scopes](deploy-rest.md#deployment-scope).
191
-
* **ConnectedServiceName**: Specify the service connection name that you created earlier.
192
-
* **SubscriptionName**: Specify the target subscription ID.
193
-
* **action**: the **Create Or Update Resource Group** action does 2 actions - 1. create a resource group if a new resource group name is provided; 2. deploy the template specified.
194
-
* **resourceGroupName**: specify a new resource group name. For example, **AzureRmPipeline-rg**.
195
-
* **location**: specify the location for the resource group.
196
-
* **templateLocation**: when **Linked artifact** is specified, the task looks for the template file directly from the connected repository.
197
-
* **csmFile** is the path to the template file. You don't need to specify a template parameters file because all of the parameters defined in the template have default values.
198
-
* **overrideParameters**: used to override the parameters. The linked template URL is what you wrote down at the end of [Create a Github repository](#create-a-github-repository).
For more information about the task, see [Azure Resource Group Deployment task](/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment), and [Azure Resource Manager template deployment task](https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureResourceManagerTemplateDeploymentV3/README.md)
201
194
1. Select **Save and run**.
202
195
1. Select **Save and run** again. A copy of the YAML file is saved into the connected repository. You can see the YAML file by browse to your repository.
203
196
1. Verify that the pipeline is executed successfully.
When you update the template and push the changes to the remote repository, the pipeline automatically updates the resources, the storage account in this case.
219
210
220
-
1. Open **azuredeploy.json** from your local repository in Visual Studio Code.
211
+
1. Open **linkedStorageAccount.json** from your local repository in Visual Studio Code or any text editor.
221
212
1. Update the **defaultValue** of **storageAccountType** to **Standard_GRS**. See the following screenshot:
1. Push the changes to the remote repository by running the following commands from Git Bash/Shell.
227
218
228
219
```bash
229
220
git pull origin master
230
221
git add .
231
-
git commit -m “Add a new create storage account template.”
222
+
git commit -m “Update the storage account type.”
232
223
git push origin master
233
224
```
234
225
@@ -251,7 +242,8 @@ You might also want to delete the GitHub repository and the Azure DevOps project
251
242
252
243
## Next steps
253
244
254
-
In this tutorial, you create an Azure DevOps pipeline to deploy an Azure Resource Manager template. To learn how to deploy Azure resources across multiple regions, and how to use safe deployment practices, see
245
+
Congratulations, you've finished this Resource Manager template deployoment tutorial. Let us know if you have any comments and suggestions in the feedback section. Thanks!
246
+
You're ready to jump into more advanced concepts about templates. The next tutorial goes into more detail about using template reference documentation to help with defining resources to deploy.
0 commit comments