Skip to content

Commit 7c091bb

Browse files
authored
gh-action (#8)
* Configure Azure Developer Pipeline * Configure Azure Developer Pipeline * Configure Azure Developer Pipeline * Configure Azure Developer Pipeline * Configure Azure Developer Pipeline * Configure Azure Developer Pipeline
1 parent 67b7157 commit 7c091bb

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/azure-dev.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
# Run when commits are pushed to mainline branch (main or master)
5+
# Set this to the mainline branch you are using
6+
branches:
7+
- main
8+
- master
9+
10+
# GitHub Actions workflow to deploy to Azure using azd
11+
# To configure required secrets for connecting to Azure, simply run `azd pipeline config`
12+
13+
# Set up permissions for deploying with secretless Azure federated credentials
14+
# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
15+
permissions:
16+
id-token: write
17+
contents: read
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
env:
23+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
24+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
25+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
26+
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Install azd
32+
uses: Azure/[email protected]
33+
34+
- name: Log in with Azure (Federated Credentials)
35+
if: ${{ env.AZURE_CLIENT_ID != '' }}
36+
run: |
37+
azd auth login `
38+
--client-id "$Env:AZURE_CLIENT_ID" `
39+
--federated-credential-provider "github" `
40+
--tenant-id "$Env:AZURE_TENANT_ID"
41+
shell: pwsh
42+
43+
- name: Log in with Azure (Client Credentials)
44+
if: ${{ env.AZURE_CREDENTIALS != '' }}
45+
run: |
46+
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
47+
Write-Host "::add-mask::$($info.clientSecret)"
48+
49+
azd auth login `
50+
--client-id "$($info.clientId)" `
51+
--client-secret "$($info.clientSecret)" `
52+
--tenant-id "$($info.tenantId)"
53+
shell: pwsh
54+
env:
55+
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
56+
57+
- name: Provision Infrastructure
58+
run: azd provision --no-prompt
59+
env:
60+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
61+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
62+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
63+
64+
- name: Deploy Application
65+
run: azd deploy --no-prompt
66+
env:
67+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
68+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
69+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}

infra/app/ai.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module openai '../core/ai/cognitiveservices.bicep' = {
2121
model: {
2222
format: 'OpenAI'
2323
name: chatGptModelName
24-
version: '0301'
24+
version: '0613'
2525
}
2626
sku: {
2727
name: 'Standard'

0 commit comments

Comments
 (0)