Create a CI/CD Pipeline Using PowerShell DSC

1.25 hours
  • 4 Learning Objectives

About this Hands-on Lab

You need to deploy a Windows server with IIS installed via CI/CD Pipeline. Given the appropriate ARM templates, deploy this virtual machine (VM) to Azure using Azure DevOps.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an Azure DevOps Organization
  1. Log in to the Azure portal using the provided credentials.
  2. Search for Azure DevOps from the Services menu.
  3. Create a new organization and project named MyFirstProject.
Push Code to Azure Repos
  1. Log in to the Linux virtual machine provided with this lab.
  2. Clone the DSC branch of the repository from GitHub.
  3. Remove the GitHub origin.
  4. Copy the commands from Azure Repos to add the new remote origin, then push the code.
Create CI/CD Build and Release Pipelines
  1. Create a new Azure build pipeline in the classic editor.
  2. Add the appropriate tasks to copy and publish the ARM template to the artifact staging location.
  3. Create a new release pipeline in Azure DevOps.
  4. Use the artifact created in the previous objective.
  5. Create the necessary task to deploy the ARM template.
  6. Create a service connection using the service principal provided.
  7. Ensure that the service connection is used within the release pipeline task.
  8. Utilize variables for template override parameters for the adminUsername and adminPassword for the Windows VM.
Verify Successful IIS Installation on Windows VM
  1. Download the RDP file for the newly created Windows VM.
  2. Connect to the VM using an RDP client appropriate for your operating system.
  3. Utilize the same credentials for the adminUsername and adminPassword variables to log in to the VM.
  4. Navigate to a web browser via run or a browser and visit http://localhost to verify that the IIS splash page loads without issue.

Additional Resources

Start by logging in to the Azure portal and searching for Azure DevOps from the Services menu. Proceed to create a new Azure DevOps organization and project named "MyFirstProject". Log in to the Linux VM via SSH to clone the ARM branch of the repository using this command:

git clone -b DSC https://github.com/linuxacademy/content-az400-lab-resources.git

Once the code is in Azure Repos, create a build and release pipeline to deploy the VM to Azure. Include a service connection to connect to the Azure environment from Azure DevOps.

RDP Connection Methods

Windows Users

Check out this link for connecting via RDP in Windows.

Mac Users

To connect via RDP on a Mac, you will need additional software. This software from Microsoft is available for free to connect from macOS. Check out this link to the software.

Linux Users

As there are many different flavors and distributions of Linux, there isn't a best method for connecting via RDP that fits all distributions that we can recommend. Some options to consider are FreeRDP, rDesktop, Remmina, or Vinagre, depending on your OS.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?