Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Azure icon
Labs

Provide Continuous Delivery with GitHub and Terraform Cloud for Azure

In this hands-on lab, you'll create a Git repository for Terraform for your Terraform infrastructure and configure continuous delivery (CD) using GitHub Actions and Terraform Cloud.

Azure icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 45m
Published
Clock icon Feb 09, 2023

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Set Up Your Environment

    1. Set up your development environment by connecting to the Virtual Machine using remote desktop and the credentials provided.
    2. Within the Virtual Machine, using Microsoft Edge, log in to the Azure Portal using the credentials provided. Then log in to your GitHub account and your Terraform Cloud account.
  2. Challenge

    Create a GitHub Repository

    Create a GitHub repository for your Terraform infrastructure.

  3. Challenge

    Create a Workspace in Terraform Cloud

    1. Go to https://app.terraform.io/ and create a Terraform Cloud workspace.
    2. Create four environment variables to authorize access to Azure, with the following details:
      1. ARM_SUBSCRIPTION_ID - Use the subscription ID from the Azure portal.
      2. ARM_CLIENT_ID - Use the Client ID from the lab details.
      3. ARM_CLIENT_SECRET - Marked as sensitive, use the client secret from the lab details.
      4. ARM_TENANT_ID - Use the Azure AD Tenant ID from the Azure portal.
  4. Challenge

    Configure Continuous Delivery

    1. Create a GitHub Actions workflow using the following YAML file.
    2. Create a GitHub Actions repository secret with the name TF_API_TOKEN and use the value of a Terraform Cloud API User Token.
  5. Challenge

    Configure Branch Protection Rules

    Create a branch protection rule to protect the main branch by requiring approvals and preventing bypassing of the configured protection rules.

  6. Challenge

    Author the Configuration

    1. Clone the Git repository to the virtual machine.
    2. Create a branch for your work.
    3. Use the terraform file named main.tf in the C:\Terraform folder on the workstation.
    4. Add the Terraform Cloud configuration from your Terraform Cloud workspace.
    5. Import the existing resource group for the hands-on-lab into your state.
    6. Commit your changes and publish your branch.
  7. Challenge

    Create and Complete a Pull Request

    1. Create and complete a pull request to push your changes to the main branch.

      To complete the pull request without a second reviewer, you will need to Allow bypassing branch protection rules by deselecting Do not allow bypassing the above settings in the branch protection policy.

  8. Challenge

    Review Results

    1. Review the results in GitHub Actions.
    2. Review the results in the Azure portal.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans