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.
The following image illustrates the steps in this challenge
- 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.
- 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.
- The Customer API is deployed using GitHub Actions workflow and Bicep to Container Apps.
- Validate that the Customer API is working from VS Code.
- Using workflows in GitHub
- GitHub environment variables
- az acr build reference
- Use secrets in Bicep
- Deploy Container Apps
- View the solution here, Challenge 4 - Solution
- Challenge 1: Setup the environment
- Challenge 2: Get familiar with Azure API Management (APIM)
- Challenge 3: Use Bicep for deployment to APIM
- Challenge 4: Create a CI/CD GitHub Action and deploy to Container Apps
- Challenge 5: Use the CI/CD GitHub Action to deploy changes to APIM
- Challenge 6: Add a policy using Bicep
- Challenge 7: Managing Development/Production environments.