You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blogs/series-5-devops-data/5.4-azure-bicep-infrastructure.md
+38-18Lines changed: 38 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Clicking through the Azure Portal to create seven resources manually is slow, er
6
6
7
7
Azure Bicep solves this. One file describes the desired state. One command creates everything. Run it again and Azure updates only what changed. The same template creates both a dev environment and a production environment identically.
8
8
9
-
This article walks through the Bicep templates that provision the full Talent Management stack — App Service Plan, two Web Apps, a Static Web App, a shared SQL Server, and two databases — and runs the deployment against a real Azure subscription.
9
+
This article walks through the Bicep templates that provision the full Talent Management stack — App Service Plan, three Web Apps, a Static Web App, a shared SQL Server, and two databases — and runs the deployment against a real Azure subscription.
// sqlAdminPassword is NOT here — pass it at deploy time
273
293
```
@@ -292,7 +312,7 @@ az group create \
292
312
--location eastus
293
313
```
294
314
295
-
Deploy all seven resources:
315
+
Deploy all eight resources:
296
316
297
317
```bash
298
318
az deployment group create \
@@ -331,19 +351,19 @@ az resource list \
331
351
--output table
332
352
```
333
353
334
-
You should see seven resources: one App Service Plan, two Web Apps, one Static Site, one SQL Server, and two SQL Databases.
354
+
You should see eight resources: one App Service Plan, three Web Apps, one Static Site, one SQL Server, and two SQL Databases.
335
355
336
356
Navigate to each Web App in the Portal (`portal.azure.com → App Services → app-talent-api-dev`) and confirm the URL opens — it will show a default "Your web app is running" page until the .NET application is deployed in Article 5.6.
337
357
338
358
---
339
359
340
360
## 🔑 Key Design Decisions
341
361
342
-
**One shared App Service Plan for both .NET apps.** Azure charges at the App Service Plan level, not per Web App. Running two Web Apps on one B1 plan costs the same as running one Web App on that plan. Separate plans would double the compute cost for no benefit at this scale.
362
+
**One shared App Service Plan for all three .NET apps.** Azure charges at the App Service Plan level, not per Web App. Running three Web Apps (API, IdentityServer STS, and IdentityServer Admin) on one B1 plan costs the same as running one. Separate plans would triple the compute cost for no benefit at this scale.
343
363
344
364
**`@secure()` for SQL password — never in the parameters file.** Bicep's `@secure()` decorator marks a parameter as sensitive. The value is excluded from deployment logs and history. Passing it via `--parameters sqlAdminPassword="$SQL_ADMIN_PASSWORD"` at deploy time, sourced from an environment variable or GitHub Secret, ensures the password never touches source control.
345
365
346
-
**Bicep outputs over hardcoded URLs.**`main.bicep` outputs `apiAppUrl`, `identityAppUrl`, and `angularAppUrl`. GitHub Actions workflows read these outputs instead of hardcoding URLs — if the resource name changes, the URLs update automatically.
366
+
**Bicep outputs over hardcoded URLs.**`main.bicep` outputs `apiAppUrl`, `identityAppUrl`, `identityAdminAppUrl`, and `angularAppUrl`. GitHub Actions workflows read these outputs instead of hardcoding URLs — if the resource name changes, the URLs update automatically.
347
367
348
368
**`skipGithubActionWorkflowGeneration: true` on Static Web App.** Azure would auto-generate a GitHub Actions file and commit it to the repository. The custom workflow in Article 5.7 handles environment variable injection that the auto-generated workflow cannot. Skipping auto-generation prevents a generated workflow from conflicting with the custom one.
349
369
@@ -355,7 +375,7 @@ Navigate to each Web App in the Portal (`portal.azure.com → App Services → a
355
375
356
376
Infrastructure as Code is not just a DevOps practice — it is documentation. Every resource configuration, every SKU choice, every firewall rule is in source control and can be reviewed, questioned, and approved through a pull request. The Bicep files in this article are the complete specification of what is running in Azure.
357
377
358
-
The module pattern — one reusable `webApp.bicep` used for both the APIand IdentityServer — demonstrates a core Bicep principle: parameterize what varies, fix what doesn't. Adding a third Web App to this infrastructure requires one additional module call and one additional parameter. The module itself does not change.
378
+
The module pattern — one reusable `webApp.bicep` used for the API, IdentityServer STS, and IdentityServer Admin — demonstrates a core Bicep principle: parameterize what varies, fix what doesn't. Adding another Web App requires one additional module call and one additional parameter. The module itself does not change.
0 commit comments