Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 3.39 KB

challenge5.md

File metadata and controls

57 lines (39 loc) · 3.39 KB

Challenge 5: Configure CI/CD for Container Apps

Azure Container Apps allows you to use GitHub Actions to publish revisions to your Container App. As commits are pushed to your GitHub repository, a GitHub Action is triggered which updates the container image in the container registry. Once the container is updated in the registry, Azure Container Apps creates a new revision based on the updated container image.

Until now we have worked with docker images that others have created, now we are going to do a code change on our own code base and push the changes to Container Apps using GitHub Actions. We are now going to use a Azure CLI command to create a GitHub Action that builds the Queue Reader C# project and pushes the image to Azure Container Registry and deploys it to our Container App.

The following image illustrates the steps in this challenge

Main objectives

  • Configure CI/CD deployment of a Container App using GitHub actions
  • Make a code change and deploy new version of Container App
  • Verify changes after deployment

Activities

  • Create a Microsoft Entra ID service principal with contributor permissions on your resource group
  • Create a Personal Access Token (PAT) in GitHub with permissions to your repository and GitHub actions
  • Add a GitHub Actions workflow to your repository to deploy a container app
  • Do a code change in Queue Reader app and push changes to GitHub repository
  • Add a new order using HTTP API
  • Verify that the code change has been deployed by looking in Log Analytics

Definition of done

  • Created a Microsoft Entra ID service principal and assigned it contributor access on your resource group
  • Created a Personal Access Token (PAT) in GitHub with repo and workflows permissions
  • Created a GitHub Actions workflow in your repository to deploy a container app
  • Changed the C# code in Queue Reader app to write a custom log message
  • Pushed the changes to your GitHub repo
  • Verified that the new version of your Queue Reader app was successfully deployed
  • Added an order by doing a HTTP POST to Http API (https://httpapi.[your container app environment domain]/data?message=[your message])
  • Verified logs in Log Analytics for Queue Reader application that the new Queue Reader Container App is logging with your custom log message

Helpful links

Solution

The challenges