Skip to content

Commit 53e611c

Browse files
committed
update the pipeline tutorial
1 parent 70942e8 commit 53e611c

10 files changed

+37
-42
lines changed

articles/azure-resource-manager/templates/deployment-tutorial-linked-template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ The following PowerShell script creates a storage account, creates a container,
3838

3939
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:
4040

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+
4144
```azurepowershell-interactive
4245
$projectName = Read-Host -Prompt "Enter a project name:" # This name is used to generate names for Azure resources, such as storage account name.
4346
$location = Read-Host -Prompt "Enter a location (i.e. centralus)"

articles/azure-resource-manager/templates/deployment-tutorial-pipeline.md

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ If you are already familiar with GitHub and DevOps, you can skip to [Create a pi
1717

1818
> [!NOTE]
1919
> 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.
2021
2122
This tutorial covers the following tasks:
2223

@@ -37,7 +38,7 @@ To complete this article, you need:
3738
* **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).
3839
* **Install Git**. This tutorial instruction uses *Git Bash* or *Git Shell*. For instructions, see [Install Git]( https://www.atlassian.com/git/tutorials/install-git).
3940
* **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).
4142

4243
## Prepare a GitHub repository
4344

@@ -50,7 +51,7 @@ If you don’t have a GitHub account, see [Prerequisites](#prerequisites).
5051
1. Sign in to [GitHub](https://github.com).
5152
1. Select your account image on the upper right corner, and then select **Your repositories**.
5253

53-
![Azure Resource Manager Azure DevOps Azure Pipelines create GitHub repository](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-github-repository.png)
54+
![Azure Resource Manager Azure DevOps Azure Pipelines create GitHub repository](./media/deployment-tutorial-pipeline/azure-resource-manager-devops-pipelines-github-repository.png)
5455

5556
1. Select **New**, a green button.
5657
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
120121
1. Sign in to [Azure DevOps](https://dev.azure.com).
121122
1. Select a DevOps organization from the left.
122123

123-
![Azure Resource Manager Azure DevOps Azure Pipelines create Azure DevOps project](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-create-devops-project.png)
124+
![Azure Resource Manager Azure DevOps Azure Pipelines create Azure DevOps project](./media/deployment-tutorial-pipeline/azure-resource-manager-devops-pipelines-create-devops-project.png)
124125

125126
1. Select **New project**. If you don't have any projects, the create project page is opened automatically.
126127
1. Enter the following values:
@@ -159,50 +160,42 @@ To create a pipeline with a step to deploy a template:
159160
1. Select **New pipeline**.
160161
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**.
161162
162-
![Azure Resource Manager Azure DevOps Azure Pipelines only select repositories](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-only-select-repositories.png)
163+
![Azure Resource Manager Azure DevOps Azure Pipelines only select repositories](./media/deployment-tutorial-pipeline/azure-resource-manager-devops-pipelines-only-select-repositories.png)
163164
164165
1. From the **Select** tab, select your repository. The default name is **[YourAccountName]/[YourGitHubRepositoryName]**.
165166
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:
167-
168-
```yaml
169-
steps:
170-
- task: AzureResourceManagerTemplateDeployment@3
171-
inputs:
172-
deploymentScope: 'Resource Group'
173-
ConnectedServiceName: '[EnterYourServiceConnectionName]'
174-
subscriptionName: '[EnterTheTargetSubscriptionID]'
175-
action: 'Create Or Update Resource Group'
176-
resourceGroupName: '[EnterANewResourceGroupName]'
177-
location: 'Central US'
178-
templateLocation: 'Linked artifact'
179-
csmFile: 'CreateWebApp/azuredeploy.json'
180-
overrideParameters: '-projectName [EnterAProjectName] -linkedTemplateUri [EnterTheLinkedTemplateURL]'
181-
deploymentMode: 'Incremental'
182-
```
167+
1. Delete the two script steps from the yml file.
168+
1. Move the cursor to the line after **steps:**.
169+
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:
183172
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**.
185+
186+
1. Select **Add**.
185187
186-
![Azure Resource Manager Azure DevOps Azure Pipelines yaml](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-yml.png)
188+
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)
187189
188-
Make the following changes:
190+
The yml file shall be similar to:
189191
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).
192+
![Azure Resource Manager Azure DevOps Azure Pipelines yaml](./media/deployment-tutorial-pipeline/azure-resource-manager-devops-pipelines-yml.png)
199193
200-
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)
201194
1. Select **Save and run**.
202195
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.
203196
1. Verify that the pipeline is executed successfully.
204197
205-
![Azure Resource Manager Azure DevOps Azure Pipelines yaml](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-status.png)
198+
![Azure Resource Manager Azure DevOps Azure Pipelines yaml](./media/deployment-tutorial-pipeline/azure-resource-manager-devops-pipelines-status.png)
206199
207200
## Verify the deployment
208201
@@ -211,24 +204,22 @@ To create a pipeline with a step to deploy a template:
211204
1. Select the storage account name to open it.
212205
1. Select **Properties**. Notice the **Replication** is **Locally-redundant storage (LRS)**.
213206
214-
![Azure Resource Manager Azure DevOps Azure Pipelines portal verification](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-portal-verification.png)
215-
216207
## Update and redeploy
217208
218209
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.
219210
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.
221212
1. Update the **defaultValue** of **storageAccountType** to **Standard_GRS**. See the following screenshot:
222213
223-
![Azure Resource Manager Azure DevOps Azure Pipelines update yaml](./media/template-tutorial-use-azure-pipelines/azure-resource-manager-devops-pipelines-update-yml.png)
214+
![Azure Resource Manager Azure DevOps Azure Pipelines update yaml](./media/deployment-tutorial-pipeline/azure-resource-manager-devops-pipelines-update-yml.png)
224215
225216
1. Save the changes.
226217
1. Push the changes to the remote repository by running the following commands from Git Bash/Shell.
227218
228219
```bash
229220
git pull origin master
230221
git add .
231-
git commit -m “Add a new create storage account template.”
222+
git commit -m “Update the storage account type.”
232223
git push origin master
233224
```
234225
@@ -251,7 +242,8 @@ You might also want to delete the GitHub repository and the Azure DevOps project
251242
252243
## Next steps
253244
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.
255247
256248
> [!div class="nextstepaction"]
257-
> [Use safe deployment practices](./deployment-manager-tutorial.md)
249+
> [Utilize template reference](./template-tutorial-create-encrypted-storage-accounts.md)
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)