Skip to content

Commit 878a8bb

Browse files
committed
Configure Azure Developer Pipeline
1 parent b5412fd commit 878a8bb

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/azure-dev.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Run when commits are pushed to main
2+
on:
3+
workflow_dispatch:
4+
push:
5+
# Run when commits are pushed to mainline branch (main or master)
6+
# Set this to the mainline branch you are using
7+
branches:
8+
- main
9+
10+
# Set up permissions for deploying with secretless Azure federated credentials
11+
# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
12+
permissions:
13+
id-token: write
14+
contents: read
15+
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
env:
21+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
22+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
23+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
24+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
25+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Install azd
30+
uses: Azure/[email protected]
31+
- name: Log in with Azure (Federated Credentials)
32+
run: |
33+
azd auth login `
34+
--client-id "$Env:AZURE_CLIENT_ID" `
35+
--federated-credential-provider "github" `
36+
--tenant-id "$Env:AZURE_TENANT_ID"
37+
shell: pwsh
38+
39+
40+
- name: Provision Infrastructure
41+
run: azd provision --no-prompt
42+
env:
43+
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
44+
45+
- name: Deploy Application
46+
run: azd deploy --no-prompt

0 commit comments

Comments
 (0)