Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 2.88 KB

challenge4.md

File metadata and controls

46 lines (31 loc) · 2.88 KB

Challenge 4: Create a CI/CD Github Action and deploy to Container Apps.

Until now you have worked with publicly available API's, now its time to work with the API that is located in this repo under api/CustomerAPI. It's a simple .net Core 6.0 API that has been forked and modified from https://github.com/Vivekkosare/CustomerAPI (kudos @VKosare). In this challenge you will use a GitHub Action to first build and push the code to an Azure Container Registry. Once that is done you will deploy the container image to Azure Container Apps using Bicep.

Main objectives

  • Create a GitHub Action workflow and use Azure Container Registry to build and create a docker image.
  • Deploy the Customer API to Container Apps using a GitHub Action and Bicep.

Activities

  • Create a GitHub Action workflow and trigger the workflow when code changes inside the folder api/CustomerAPI. All the activities below should be done in the GitHub Action workflow.
  • Use Azure CLI inside the GitHub Action workflow to build and create a docker image in Azure Container Registry. Use the system environment variable ${{ github.run_number }} to set the docker image tag and pass it into the Bicep file that deploys the Container App.
  • Deploy a Container App and use the docker image that was previously built in Azure Container Registry using Bicep.
  • Use the secret "dbconnection" in Azure Key Vault as a Secret in Container Apps to connect to the Azure SQL database.
  • Validate that the API works in Container Apps.

Definition of done

  • The Customer API is deployed using GitHub Actions workflow and Bicep to Container Apps.
  • Validate that the Customer API is working from VS Code.

Helpful links

Solution

The challenges