Using Bicep for automating your Azure App Service and GitHub Actions workflow
This tutorial will be going through how to create a deployment using Bicep to create an Azure App Service that creates a GitHub Actions workflow file to build and deploy a Docker image.
Overview
I've been using infrastructure as code (IaC) for a couple of years now, though it has usually been Terraform. I love how powerful it can be, being able to spin up environments with the exact same template and configuration in a repeatable way is really powerful. No more anomalies between environments, or manual changes that seemingly 'fix' things but no one knows how. With IaC, changes that are made are documented as code and are repeatable, thus saving us long term pain. That's the real power of tools like Terraform and Bicep.
So I've usually used Terraform for my deployments in the past, but for this series. I'm going to be using Bicep where possible, mainly because I think there is less useful documentation on Bicep and so I hope to help in this area where I can!
If you go back to my precious article you will see I manually set up an Azure App Service via the portal that created a GitHub Actions workflow. I will be showing you how I do this via Bicep so that you can easily make changes to your infrastructure and do this repeatably and reliably.
In order to create the infrastructure we need, we need to create the following things:
A resource group - This will store your resources, such as your App Service Plan and App Service Web App
An App Service Plan - This will store the compute resources needed for you Web App to run. For example, the amount of VMs needed, which operating system and what pricing tier it is.
An App Service Web App - This is a fully managed compute platform, which is optimised for hosting websites and web applications. For this tutorial, we will be using a containerised image to integrate with it, but you can also use .NET, Java, Node.js, Python and PHP directly if preferred.
As well as the commands needed to deploy it to your subscription and tenant.
To do this locally, you will need the following installed:
Keep reading with a 7-day free trial
Subscribe to Tech Unfiltered to keep reading this post and get 7 days of free access to the full post archives.