Skip to content

Commit cd1447d

Browse files
authored
Merge pull request #2034 from diggerhq/docs/add-azure-quickstart
Add Azure tab to quickstarts
2 parents 45dc6d8 + a9740f4 commit cd1447d

File tree

3 files changed

+179
-0
lines changed

3 files changed

+179
-0
lines changed

docs/ce/getting-started/with-opentofu.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ In this tutorial, you will set up Digger to automate OpenTofu pull requests usin
1010
- Your cloud provider credentials:
1111
- For AWS: [Hashicorp's AWS tutorial](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build)
1212
- For GCP: [Hashicorp's GCP tutorial](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/google-cloud-platform-build)
13+
- For Azure: [Hashicorp's Azure tutorial](https://developer.hashicorp.com/terraform/tutorials/azure-get-started/azure-build)
1314

1415
# Step 1: create your Digger account
1516

@@ -42,6 +43,13 @@ In GitHub repository settings, go to Secrets and Variables - Actions. Create the
4243
- `GCP_CREDENTIALS` - contents of your GCP Service Account Key json file You
4344
can also [use OIDC](/gcp/federated-oidc-access/) for GCP authentication.
4445
</Tab>
46+
<Tab title="Azure">
47+
- `AZURE_CLIENT_ID` - Your Azure App Registration Client ID
48+
- `AZURE_TENANT_ID` - Your Azure Tenant ID
49+
- `AZURE_SUBSCRIPTION_ID` - Your Azure Subscription ID
50+
51+
You'll need to configure OIDC authentication by setting up federated credentials in your Azure App Registration. See [Azure OIDC setup](/ce/azure-specific/azure) for details.
52+
</Tab>
4553
</Tabs>
4654

4755
# Step 4: Create digger.yml
@@ -158,6 +166,57 @@ Place it at `.github/workflows/digger_workflow.yml` (name is important!)
158166
- Verify that GCP is configured correctly by running `gcloud info`
159167

160168
</Tab>
169+
<Tab title="Azure">
170+
```yaml
171+
name: Digger Workflow
172+
173+
on:
174+
workflow_dispatch:
175+
inputs:
176+
spec:
177+
required: true
178+
run_name:
179+
required: false
180+
181+
run-name: '${{inputs.run_name}}'
182+
183+
jobs:
184+
digger-job:
185+
runs-on: ubuntu-latest
186+
permissions:
187+
contents: write # required to merge PRs
188+
actions: write # required for plan persistence
189+
id-token: write # required for workload-identity-federation
190+
pull-requests: write # required to post PR comments
191+
issues: read # required to check if PR number is an issue or not
192+
statuses: write # required to validate combined PR status
193+
194+
steps:
195+
- uses: actions/checkout@v4
196+
- name: ${{ fromJSON(github.event.inputs.spec).job_id }}
197+
run: echo "job id ${{ fromJSON(github.event.inputs.spec).job_id }}"
198+
- uses: diggerhq/digger@vLatest
199+
with:
200+
digger-spec: ${{ inputs.spec }}
201+
setup-azure: true
202+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
203+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
204+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
205+
setup-opentofu: true
206+
opentofu-version: 1.10.3
207+
env:
208+
GITHUB_CONTEXT: ${{ toJson(github) }}
209+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
210+
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
211+
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
212+
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
213+
```
214+
215+
This workflow uses Azure OIDC authentication, which requires:
216+
- Setting up federated credentials in your Azure App Registration for GitHub Actions
217+
- The `id-token: write` permission for workload identity federation
218+
- ARM_* environment variables for the Azure Terraform provider
219+
</Tab>
161220
</Tabs>
162221

163222
# Step 6: Create a PR to verify that it works
@@ -172,3 +231,4 @@ Then you can add a comment like `digger apply` and shortly after apply output wi
172231

173232
- [AWS demo repo](https://github.com/diggerhq/quickstart-actions-aws)
174233
- [GCP demo repo](https://github.com/diggerhq/demo-conftest-gcp/)
234+
- [Azure demo repo](https://github.com/diggerhq/azure-onboarding-test)

docs/ce/getting-started/with-terraform.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ In this tutorial, you will set up Digger to automate terraform pull requests usi
1010
- Your cloud provider credentials:
1111
- For AWS: [Hashicorp's AWS tutorial](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build)
1212
- For GCP: [Hashicorp's GCP tutorial](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/google-cloud-platform-build)
13+
- For Azure: [Hashicorp's Azure tutorial](https://developer.hashicorp.com/terraform/tutorials/azure-get-started/azure-build)
1314

1415
# Step 1: create your Digger account
1516

@@ -42,6 +43,13 @@ In GitHub repository settings, go to Secrets and Variables - Actions. Create the
4243
- `GCP_CREDENTIALS` - contents of your GCP Service Account Key json file You
4344
can also [use OIDC](/gcp/federated-oidc-access/) for GCP authentication.
4445
</Tab>
46+
<Tab title="Azure">
47+
- `AZURE_CLIENT_ID` - Your Azure App Registration Client ID
48+
- `AZURE_TENANT_ID` - Your Azure Tenant ID
49+
- `AZURE_SUBSCRIPTION_ID` - Your Azure Subscription ID
50+
51+
You'll need to configure OIDC authentication by setting up federated credentials in your Azure App Registration. See [Azure OIDC setup](/ce/azure-specific/azure) for details.
52+
</Tab>
4553
</Tabs>
4654

4755
# Step 4: Create digger.yml
@@ -158,6 +166,57 @@ Place it at `.github/workflows/digger_workflow.yml` (name is important!)
158166
- Verify that GCP is configured correctly by running `gcloud info`
159167

160168
</Tab>
169+
<Tab title="Azure">
170+
```yaml
171+
name: Digger Workflow
172+
173+
on:
174+
workflow_dispatch:
175+
inputs:
176+
spec:
177+
required: true
178+
run_name:
179+
required: false
180+
181+
run-name: '${{inputs.run_name}}'
182+
183+
jobs:
184+
digger-job:
185+
runs-on: ubuntu-latest
186+
permissions:
187+
contents: write # required to merge PRs
188+
actions: write # required for plan persistence
189+
id-token: write # required for workload-identity-federation
190+
pull-requests: write # required to post PR comments
191+
issues: read # required to check if PR number is an issue or not
192+
statuses: write # required to validate combined PR status
193+
194+
steps:
195+
- uses: actions/checkout@v4
196+
- name: ${{ fromJSON(github.event.inputs.spec).job_id }}
197+
run: echo "job id ${{ fromJSON(github.event.inputs.spec).job_id }}"
198+
- uses: diggerhq/digger@vLatest
199+
with:
200+
digger-spec: ${{ inputs.spec }}
201+
setup-azure: true
202+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
203+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
204+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
205+
setup-terraform: true
206+
terraform-version: 1.5.5
207+
env:
208+
GITHUB_CONTEXT: ${{ toJson(github) }}
209+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
210+
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
211+
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
212+
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
213+
```
214+
215+
This workflow uses Azure OIDC authentication, which requires:
216+
- Setting up federated credentials in your Azure App Registration for GitHub Actions
217+
- The `id-token: write` permission for workload identity federation
218+
- ARM_* environment variables for the Azure Terraform provider
219+
</Tab>
161220
</Tabs>
162221

163222
# Step 6: Create a PR to verify that it works
@@ -172,3 +231,4 @@ Then you can add a comment like `digger apply` and shortly after apply output wi
172231

173232
- [AWS demo repo](https://github.com/diggerhq/quickstart-actions-aws)
174233
- [GCP demo repo](https://github.com/diggerhq/demo-conftest-gcp/)
234+
- [Azure demo repo](https://github.com/diggerhq/azure-onboarding-test)

docs/ce/getting-started/with-terragrunt.mdx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ In this tutorial, you will set up Digger to automate Terragrunt pull requests us
1010
- Your cloud provider credentials:
1111
- For AWS: [Hashicorp's AWS tutorial](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build)
1212
- For GCP: [Hashicorp's GCP tutorial](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/google-cloud-platform-build)
13+
- For Azure: [Hashicorp's Azure tutorial](https://developer.hashicorp.com/terraform/tutorials/azure-get-started/azure-build)
1314

1415
# Step 1: create your Digger account
1516

@@ -44,6 +45,13 @@ In GitHub repository settings, go to Secrets and Variables - Actions. Create the
4445

4546
You can also [use OIDC](/gcp/federated-oidc-access/) for GCP authentication.
4647
</Tab>
48+
<Tab title="Azure">
49+
- `AZURE_CLIENT_ID` - Your Azure App Registration Client ID
50+
- `AZURE_TENANT_ID` - Your Azure Tenant ID
51+
- `AZURE_SUBSCRIPTION_ID` - Your Azure Subscription ID
52+
53+
You'll need to configure OIDC authentication by setting up federated credentials in your Azure App Registration. See [Azure OIDC setup](/ce/azure-specific/azure) for details.
54+
</Tab>
4755
</Tabs>
4856

4957
# Step 4: Create digger.yml
@@ -204,6 +212,57 @@ Place it at `.github/workflows/digger_workflow.yml` (name is important!)
204212
- Set up Google Cloud SDK for use in the subsequent steps via Google's official [Setup-gcloud action](https://github.com/google-github-actions/setup-gcloud)
205213
- Verify that GCP is configured correctly by running `gcloud info`
206214
</Tab>
215+
<Tab title="Azure">
216+
```yaml
217+
name: Digger Workflow
218+
219+
on:
220+
workflow_dispatch:
221+
inputs:
222+
spec:
223+
required: true
224+
run_name:
225+
required: false
226+
227+
run-name: '${{inputs.run_name}}'
228+
229+
jobs:
230+
digger-job:
231+
runs-on: ubuntu-latest
232+
permissions:
233+
contents: write # required to merge PRs
234+
actions: write # required for plan persistence
235+
id-token: write # required for workload-identity-federation
236+
pull-requests: write # required to post PR comments
237+
issues: read # required to check if PR number is an issue or not
238+
statuses: write # required to validate combined PR status
239+
240+
steps:
241+
- uses: actions/checkout@v4
242+
- name: ${{ fromJSON(github.event.inputs.spec).job_id }}
243+
run: echo "job id ${{ fromJSON(github.event.inputs.spec).job_id }}"
244+
- uses: diggerhq/digger@vLatest
245+
with:
246+
digger-spec: ${{ inputs.spec }}
247+
setup-azure: true
248+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
249+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
250+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
251+
setup-terragrunt: true
252+
terragrunt-version: 0.44.1
253+
env:
254+
GITHUB_CONTEXT: ${{ toJson(github) }}
255+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
256+
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
257+
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
258+
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
259+
```
260+
261+
This workflow uses Azure OIDC authentication, which requires:
262+
- Setting up federated credentials in your Azure App Registration for GitHub Actions
263+
- The `id-token: write` permission for workload identity federation
264+
- ARM_* environment variables for the Azure Terraform provider
265+
</Tab>
207266
</Tabs>
208267

209268
<Note>

0 commit comments

Comments
 (0)