Table of contents
This series is a Work in Progress
Azure Kubernetes Service
Azure Kubernetes Service (AKS) is a managed container orchestration service, based on the open source Kubernetes system, which is available on the Microsoft Azure public cloud. Azure Kubernetes Service is used to deploy and manage containerized applications more easily and efficiently. Azure Kubernetes Service offers serverless Kubernetes, an integrated continuous integration and continuous delivery (CI/CD) experience, and enterprise-grade security and governance. Unite your development and operations teams on a single platform to rapidly build, deliver, and scale applications with confidence.
Why?
Most of the time, I deploy my .Net apps to Hetzner Cloud. I have written a collection of articles on how to deploy .Net apps to Hetzner Cloud. But When I do consulting work, I deploy the apps to Azure because most of my clients are using Azure. So I thought it would be a good idea to write a collection of articles on how to deploy .Net apps to Azure.
Who is this for?
This is for anyone who wants to deploy their .Net application to Azure. I will be using GitHub Actions to build and push the Docker image to Azure Container Registry. I will be using Terraform to create the AKS cluster and deploy the .Net application to AKS. So you should have some basic knowledge of Docker, GitHub Actions, and Terraform.
Prerequisites
Azure CLI
The Azure CLI is a command-line tool for managing Azure resources. Make sure you have the Azure CLI installed on your machine. You can install the Azure CLI from here. You can check if the Azure CLI is installed on your machine by running the following command.
az --version
Azure login
You need to login to your Azure account using the Azure CLI. You can login to your Azure account by running the following command. This will open a browser window and ask you to login to your Azure account. Once you login to your Azure account, you will be able to run Azure CLI commands.
az login
if you are part of multiple subscriptions, you can set the default subscription by running the following command. Replace the SUBSCRIPTION_ID
with your subscription id.
az account set --subscription="SUBSCRIPTION_ID"
Docker desktop
You need to install Docker desktop on your machine. You can install Docker desktop from here. Once you install Docker desktop, you can check if Docker is installed on your machine by running the following command.
docker --version
Kubectl
You need to install Kubectl on your machine. You can install Kubectl from here. Once you install Kubectl, you can check if Kubectl is installed on your machine by running the following command.
kubectl version --client
Helm
You need to install Helm on your machine. You can install Helm from here. Once you install Helm, you can check if Helm is installed on your machine by running the following command.
helm version
Terraform
You need to install Terraform on your machine. You can install Terraform from here. Once you install Terraform, you can check if Terraform is installed on your machine by running the following command.
terraform version
CloudFlare
Cloudflare proves the api to manage the DNS. So we will use the Cloudflare api to manage the DNS for our application. You can create a Cloudflare account from here. Once you create a Cloudflare account, you need to get the API key from the Cloudflare dashboard and cloudflare zone id. You can get the API key from the Cloudflare dashboard by going to My Profile
and then API Tokens
. You can get the zone id from the Cloudflare dashboard by going to DNS
and then Advanced Details
. You can get the zone id from the Zone ID
field.
GitHub Actions
We will be using GitHub Actions to build and push the Docker image to Azure Container Registry. So you need to create a GitHub account from here. Once you create a GitHub account, you need to create a GitHub repository. You can create a GitHub repository by clicking on the New
button on the GitHub dashboard. You can name the repository anything you want. I will be naming the repository azure-deployment-for-dotnet
. You can leave the repository as public and click on the Create repository
button.
What does this series cover?
I want to cover the start to finish of deploying a .Net application to Azure. I will be using GitHub Actions to build and push the Docker image to Azure Container Registry. I will be using Terraform to create the AKS cluster and deploy the .Net application to AKS.
Part 0 - Prerequisites
Part 1 - Setup Terraform to create Azure Kubernetes Service (AKS) Cluster and Container Registry
Part 2 - Setup K8s to deploy CertManager, Nginx Ingress Controller with Static IP
Part 3 - Setup CloudFlare DNS for Azure Kubernetes Service (AKS) Cluster
Part 4 - Deploy a sample whoami application with HTTPS enabled
Part 5 - Setup GitHub Actions to build, Version and push Docker image to Azure Container Registry
Part 6 - Setup GitHub Actions to deploy .Net application to Azure Kubernetes Service (AKS) Cluster
Conclusion
This is the introduction to the Azure Deployment for .Net series. In the next article, we will setup GitHub Actions to build, Version and push Docker image to Azure Container Registry. If you have any questions or feedback, please feel free to post them in the comments section.