Self Host on Azure
This guide will show you how to set up digger orchestrator on azure and setup your github workflow to trigger workflow on azure! This guide assumes that you are using github actions for CI. Lets get started
Installing the orchestrator
The easiest way to install the orchestrator is via helmchart in kubernetes. The deployed service needs to be able to listen to webhooks from github for using github actions
Install the helm chart
Install the digger-backend
helm chart from https://diggerhq.github.io/helm-charts/, leaving empty all the data related to the GitHub App. You can also use the postgres database defined within the helmchart or define your own. Here’s a good starter set for my-values.yml:
you can save this file in a file like mydigger.yml
and run the following helm commands to install it in your k8s cluster:
This will be: using the latest tag as of this guide v0.6.101. It will also use a NodePort, you can use Loadbalancer or ClusterIP instead if relevant. It will enable http basic auth for the service, make sure to change the password! It will also launch a postgres instance as a continaer for your quick test. In prod we advice launching a managed postgres instance for persistence.
If all goes well you will see this fancy welcome screen when you visit the endpoint
Now you can visit /github/setup endpoint and you will be greeted with this setup wizard for creation of a digger github app with the right settings
After successful installation you will see all the github credentials in the redirect including ID, webhook secret, private key and so on
Now we need to update the values from mydigger.yml above for these secrets:
Next is to update the helmchart:
Now we can install the newly created github app into the org and if all goes well we should see a succesful installation (pick the test repo where you have terraform in)!
Perfect, with all these steps we are finally ready to create the digger configuration in the repo and perform our first PR deployment to azure!
Configuring Azure terraform repo
Configure OIDC credentials for actions
We can configure OIDC access using a registration app and subscription ID access.
To get these Azure OIDC authentication values, you’ll need to set up an Azure App Registration and gather the required identifiers. Here’s how to obtain each value:
Azure Client ID
- Go to the Azure Portal (portal.azure.com)
- Navigate to Azure Active Directory > App registrations
- Create a new app registration or select an existing one
- On the app’s Overview page, copy the Application (client) ID
Azure Tenant ID
- In the same app registration’s Overview page, copy the Directory (tenant) ID
- Alternatively, go to Azure Active Directory > Overview and find the Tenant ID
Azure Subscription ID
- Go to Subscriptions in the Azure Portal
- Select the subscription you want to use
- Copy the Subscription ID from the overview page
Setting up for GitHub Actions OIDC
For GitHub Actions with OIDC (which is likely what you’re setting up), you’ll also need to:
- Configure the App Registration for OIDC:
- In your app registration, go to Certificates & secrets
- Under Federated credentials, add a new credential
- Choose GitHub Actions deploying Azure resources
- Set the organization, repository, and environment/branch details
- Add secrets to your GitHub repository:
- Go to your GitHub repo > Settings > Secrets and variables > Actions
- Add these as repository secrets:
AZURE_CLIENT_ID
AZURE_TENANT_ID
AZURE_SUBSCRIPTION_ID
Configure Github workflow:
create this github workflow in your repository under .github/workflow/digger_workflow.yml
Create a digger.yml in the root of the repository with one project as follows:
Here is some some sample terraform for you to try:
you can commit that to main, and after that you can create a pull request to see digger start planning your changes:
Excellent! finally you can comment “digger apply” to apply the changes, congratulations you have setup digger successfully for azure! This include PR level locks, planning on PR and commenting to apply.