Demonstrates how to deploy a Self-Hosted Runner on Azure Container Apps with Terraform
- terraform
- az cli
- docker
- a github repository
- a subscription with permissions to create Resources & Assign RBAC roles
-
From your GitHub settings, create a fine-grained PAT with
Administrationrepository permissions (write) (see create a registration token for a repository) -
Create the
./terraform/terraform.auto.tfvarsfile from the following template (see variables.tf for additional information)github_pat = "" # from the previous step unique_suffix = "" github_owner = "" github_scope = "" github_repository = "" github_runner_labels = "self-hosted"
-
Deploy the infrastructure + build & push docker image in one command:
az login terraform -chdir=terraform init -upgrade ARM_SUBSCRIPTION_ID=XXXXXXXX-XXXX-XXXXXXXXX-XXXXXXXXXXXX terraform -chdir=terraform apply -auto-approve
-
Run the
Test Private Runnerworkflow from GitHub -
Once you are done testing, clean-up:
ARM_SUBSCRIPTION_ID=XXXXXXXX-XXXX-XXXXXXXXX-XXXXXXXXXXXX terraform -chdir=terraform destroy -auto-approve