Skip to content

Commit 546815b

Browse files
Add IdentityServer Admin app deployment
1 parent 49e9bb0 commit 546815b

3 files changed

Lines changed: 61 additions & 9 deletions

File tree

.github/workflows/deploy-identityserver.yml

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ env:
1717
DOTNET_VERSION: '8.x'
1818
STS_PROJECT_PATH: 'TokenService/Duende-IdentityServer/src/DuendeIdentityServer.STS.Identity/DuendeIdentityServer.STS.Identity.csproj'
1919
ADMIN_PROJECT_PATH: 'TokenService/Duende-IdentityServer/src/DuendeIdentityServer.Admin/DuendeIdentityServer.Admin.csproj'
20-
PUBLISH_DIR: '${{ github.workspace }}/publish/ids'
20+
STS_PUBLISH_DIR: '${{ github.workspace }}/publish/ids'
21+
ADMIN_PUBLISH_DIR: '${{ github.workspace }}/publish/admin'
2122
APP_SERVICE_NAME: 'app-talent-ids-dev'
23+
ADMIN_APP_SERVICE_NAME: 'app-talent-admin-dev'
2224
RESOURCE_GROUP: 'rg-talent-dev'
2325

2426
jobs:
2527
build-and-deploy:
26-
name: Build, Test, and Deploy IdentityServer
28+
name: Build and Deploy IdentityServer
2729
runs-on: ubuntu-latest
2830

2931
steps:
@@ -38,17 +40,28 @@ jobs:
3840
dotnet-version: ${{ env.DOTNET_VERSION }}
3941

4042
- name: Restore dependencies
41-
run: dotnet restore ${{ env.STS_PROJECT_PATH }}
43+
run: |
44+
dotnet restore ${{ env.STS_PROJECT_PATH }}
45+
dotnet restore ${{ env.ADMIN_PROJECT_PATH }}
4246
4347
- name: Build
44-
run: dotnet build ${{ env.STS_PROJECT_PATH }} --configuration Release --no-restore
48+
run: |
49+
dotnet build ${{ env.STS_PROJECT_PATH }} --configuration Release --no-restore
50+
dotnet build ${{ env.ADMIN_PROJECT_PATH }} --configuration Release --no-restore
4551
46-
- name: Publish
52+
- name: Publish STS
4753
run: |
4854
dotnet publish ${{ env.STS_PROJECT_PATH }} \
4955
--configuration Release \
5056
--no-build \
51-
--output ${{ env.PUBLISH_DIR }}
57+
--output ${{ env.STS_PUBLISH_DIR }}
58+
59+
- name: Publish Admin
60+
run: |
61+
dotnet publish ${{ env.ADMIN_PROJECT_PATH }} \
62+
--configuration Release \
63+
--no-build \
64+
--output ${{ env.ADMIN_PUBLISH_DIR }}
5265
5366
- name: Log in to Azure
5467
uses: azure/login@v2
@@ -57,7 +70,7 @@ jobs:
5770
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
5871
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5972

60-
- name: Configure App Service settings
73+
- name: Configure STS App Service settings
6174
run: |
6275
az webapp config appsettings set \
6376
--resource-group ${{ env.RESOURCE_GROUP }} \
@@ -66,11 +79,36 @@ jobs:
6679
"ConnectionStrings__ConfigurationDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
6780
"ConnectionStrings__PersistedGrantDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
6881
"ConnectionStrings__IdentityDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
82+
"ConnectionStrings__DataProtectionDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
6983
"AdminConfiguration__IdentityServerBaseUrl=${{ secrets.IDENTITY_SERVER_URL }}" \
7084
"ASPNETCORE_ENVIRONMENT=Production"
7185
72-
- name: Deploy to Azure App Service
86+
- name: Configure Admin App Service settings
87+
run: |
88+
az webapp config appsettings set \
89+
--resource-group ${{ env.RESOURCE_GROUP }} \
90+
--name ${{ env.ADMIN_APP_SERVICE_NAME }} \
91+
--settings \
92+
"ConnectionStrings__ConfigurationDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
93+
"ConnectionStrings__PersistedGrantDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
94+
"ConnectionStrings__IdentityDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
95+
"ConnectionStrings__AdminLogDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
96+
"ConnectionStrings__AdminAuditLogDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
97+
"ConnectionStrings__DataProtectionDbConnection=${{ secrets.IDS_DB_CONNECTION_STRING }}" \
98+
"AdminConfiguration__IdentityServerBaseUrl=${{ secrets.IDENTITY_SERVER_URL }}" \
99+
"AdminConfiguration__IdentityAdminRedirectUri=${{ secrets.IDENTITY_ADMIN_URL }}/signin-oidc" \
100+
"SeedConfiguration__ApplySeed=false" \
101+
"DatabaseMigrationsConfiguration__ApplyDatabaseMigrations=false" \
102+
"ASPNETCORE_ENVIRONMENT=Production"
103+
104+
- name: Deploy STS to Azure App Service
73105
uses: azure/webapps-deploy@v3
74106
with:
75107
app-name: ${{ env.APP_SERVICE_NAME }}
76-
package: ${{ env.PUBLISH_DIR }}
108+
package: ${{ env.STS_PUBLISH_DIR }}
109+
110+
- name: Deploy Admin to Azure App Service
111+
uses: azure/webapps-deploy@v3
112+
with:
113+
app-name: ${{ env.ADMIN_APP_SERVICE_NAME }}
114+
package: ${{ env.ADMIN_PUBLISH_DIR }}

infra/main.bicep

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ param apiAppName string
3030
@description('Name of the IdentityServer Web App')
3131
param identityAppName string
3232

33+
@description('Name of the IdentityServer Admin Web App')
34+
param identityAdminAppName string
35+
3336
@description('Name of the Angular Static Web App')
3437
param staticWebAppName string
3538

@@ -77,6 +80,15 @@ module identityApp 'modules/webApp.bicep' = {
7780
}
7881
}
7982

83+
module identityAdminApp 'modules/webApp.bicep' = {
84+
name: 'identityAdminApp'
85+
params: {
86+
webAppName: identityAdminAppName
87+
location: location
88+
appServicePlanId: appServicePlan.outputs.id
89+
}
90+
}
91+
8092
// ─── Angular Static Web App ───────────────────────────────────────────────────
8193
// Static Web Apps are not available in eastus — use eastus2
8294
module angularSwa 'modules/staticWebApp.bicep' = {
@@ -103,5 +115,6 @@ module sqlServer 'modules/sqlServer.bicep' = {
103115
// ─── Outputs (used by deployment workflows and post-deployment config) ─────────
104116
output apiAppUrl string = apiApp.outputs.url
105117
output identityAppUrl string = identityApp.outputs.url
118+
output identityAdminAppUrl string = identityAdminApp.outputs.url
106119
output angularAppUrl string = angularSwa.outputs.url
107120
output sqlServerFqdn string = sqlServer.outputs.sqlServerFqdn

infra/parameters/dev.bicepparam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using '../main.bicep'
1010
param appServicePlanName = 'asp-talent-f1-dev'
1111
param apiAppName = 'app-talent-api-dev'
1212
param identityAppName = 'app-talent-ids-dev'
13+
param identityAdminAppName = 'app-talent-admin-dev'
1314
param staticWebAppName = 'swa-talent-ui-dev'
1415
param sqlServerName = 'sql-talent-dev'
1516
param apiDbName = 'sqldb-talent-api-dev'

0 commit comments

Comments
 (0)