Pipeline Exercise 2

Continuation of the previous exercise #

This pipeline builds on the previous exercise.

Add a variable group #

The service connection is hard coded. Please replace it with a variable group and related variable. Check the Azure DevOps documentation for more details. Note that the variable group requires name/value notation in the pipeline yaml file. Verify that the changes are working.

Create a test environment #

Create a test environment of your vnet RG and vnet. You will need to create a copy of the bicep-variables-dev.yml and rename it to bicep-variables-test.yml.

Create 2 subnets from the 172.16.0.0 address space. E.g.

vnet: 172.16.0.0/25

  • 172.16.0.0/25
  • 172.16.0.128/25

Change the name of the previous subnets. Use the naming abbreviations. You can omit the Azure region in the naming recommendation.

Use the correct resource prefix.

Create a storage account #

Create a storage account and related resource group. Add a new task in the pipeline. The pipeline should create a new RG.

- task: AzureCLI@2
....

The template-variables.yml file needs a new variable for the storage resource group. You can define the name of the storage account in the same file.

We are missing the bicep module for the storage account. We want to use the latest AVM bicep module. The vnet in the previous exercise is using an older CARM bicep module.

Check the following command in the file, azure-pipelines.yml. Try to repeat the same with the AVM storage module.

az deployment group create

Implement proper folder structure #

The folder structure needs to be improved. Use the following:

deliveries
pipelines
deployments

Add the variable yaml files under deliveries directory. Pipeline folder should contain azure-pipelines.yml. Deployments folder contains the bicep modules and related wrapper files.