Skip to content

Commit

Permalink
Try add auth to dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeGinnivan committed Jul 18, 2024
1 parent e52579c commit 41e66ae
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
run: azd provision --no-prompt
env:
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
AUTH_CLIENT_ID: ${{ secrets.AUTH_CLIENT_ID }}
AUTH_CLIENT_SECRET: ${{ secrets.AUTH_CLIENT_SECRET }}

- name: Build application
run: pnpm nx build website
Expand Down
24 changes: 24 additions & 0 deletions infra/app/ddd-2024.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,27 @@ output defaultDomain string = containerAppsEnvironment.properties.defaultDomain
output name string = app.name
output uri string = 'https://${app.properties.configuration.ingress.fqdn}'
output id string = app.id

resource authConfig 'Microsoft.App/containerApps/authConfigs@2023-11-02-preview' = if (environment == 'dev') {
name: 'authconfig'
parent: containerAppResource
properties: {
globalValidation: {
unauthenticatedClientAction: 'RedirectToLoginPage'
}
identityProviders: {
azureActiveDirectory: {
enabled: true
registration: {
clientId: authClientId
clientSecretSettingName: authClientSecret
openIdIssuer: 'https://login.microsoftonline.com/${subscription().tenantId}/v2.0'
}
}
}
platform: {
enabled: true
runtimeVersion: 'v2'
}
}
}
8 changes: 7 additions & 1 deletion infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"ddd2024Exists": {
"value": "${SERVICE_DDD_2024_RESOURCE_EXISTS=false}"
},
"authClientId": {
"value": "${AUTH_CLIENT_ID}"
},
"authClientSecret": {
"value": "${AUTH_CLIENT_SECRET}"
},
"ddd2024Definition": {
"value": {
"settings": [
Expand All @@ -34,4 +40,4 @@
"value": "${AZURE_PRINCIPAL_ID}"
}
}
}
}

0 comments on commit 41e66ae

Please sign in to comment.