Deploy Uptime-Kuma on Azure

Hi There,

In the post, I am going to show how to deploy uptime kuma on Azure, It is a self-hosted monitoring tool like Uptime Robot, Status Cake, site 24×7 and etc…

First, let me explain the environment and requirements to deploy the application.

Requirements:

  • Terraform => 1.1.9
  • Azure Provider: registry.terraform.io/hashicorp/azurerm v3.3.0
  • Azure-CLI => 2.5
  • Container Image: louislam/uptime-kuma:1 (DockerHub)
  • Git => 2.30

Azure Services:

  • azureservice plan os = Linux
  • azure service plan sku = Basic
  • azure linux web app type = Docker
  • azure service principal = Password-based authentication

App Configuration:

  • WEBSITES_ENABLE_APP_SERVICE_STORAGE = true ( using app service storage to save the container data, false to disable it)
  • DOCKER_ENABLE_CI = true ( Enable CI on the Docker, when a new release deploy on the container image in use, it will trigger a deploy of the new version, false to disable it )
  • DOCKER_REGISTRY_SERVER_URL = “https://index.docker.io/v1” ( Use DockerHub as the register to download and Trigger the CI for the container image in use )
  • always_on = true ( The Azure App Service application always running )
  • websockets_enabled = true ( It`s a requirement to use uptime-kuma )
  • docker_image = “louislam/uptime-kuma” ( Container image to be use )
  • docker_image_tag = “1” ( Tags of the container image to be use )

1- Create an Azure service principal, please take a look on the link below:


https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli#password-based-authentication



2- Sign in using a service principal


https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli#4-sign-in-using-a-service-principal



3-Clone the repository and enter on the folder to be able to run the terraform comands


git clone https://github.com/leandroscardua/terraform-azure-appservice-uptime-kuma.git
cd terraform-azure-appservice-uptime-kuma


4- Edit the file variables.tf and a value on the global_name_app variable,


variable “global_name_app” {
type = string
default = “enter the name of the app here”
}



5- Run terraform init, to initialize it


terraform init



6- Run terraform plan, to validate all the configurations


terraform plan


7- Run terraform apply, to apply and install all service on Azure


terraform apply


Wait between 3 to 5 minutes to the Application be ready to use.

8- Access the website based on the name in use on the global_name_app variable.


https://{global_name_app}.azurewebsites.net/