Skip to content

feat(infra) Phase 7 A0 — Api ACA app, image tag params, deploy script#218

Merged
jkeeley2073 merged 1 commit into
mainfrom
Dev-Phase7-A0
May 15, 2026
Merged

feat(infra) Phase 7 A0 — Api ACA app, image tag params, deploy script#218
jkeeley2073 merged 1 commit into
mainfrom
Dev-Phase7-A0

Conversation

@jkeeley2073
Copy link
Copy Markdown
Contributor

Summary

Unblocks Phase 7 containerization. Three changes:

infra/modules/shared.bicep + infra/main-shared.bicep:

  • wizardImageTag + apiImageTag params (default: quickstart placeholder). CI/CD supplies explicit :{sha} tags — never :latest for ACA deployments; :latest is pushed to ACR as a convenience tag but never referenced in a deploy.
  • New apiApp ACA resource (pinwiz-ca-api-{env}) — internal ingress only (not publicly reachable); Aspire service name pinwiz-api; minReplicas=0/maxReplicas=3; system-assigned MI + AcrPull + diagnostic settings matching the wizardApp pattern.
  • services__pinwiz-api__http__0 = 'http://pinwiz-ca-api-{env}' env var on wizardApp — Aspire service discovery within the ACA environment.
  • wizardImageTag wired into the wizardApp container image (replaces the hardcoded placeholder).
  • New outputs: wizardFqdn, apiContainerAppName, apiPrincipalId.

infra/scripts/Deploy-SharedResources.ps1:

  • -WizardImageTag + -ApiImageTag optional params.
  • Auto-discovers the current running image from ACA when not supplied — prevents a manual Bicep re-deploy from reverting a CI/CD-deployed image back to the placeholder.
  • Both tags passed as inline params to az stack sub create.

Pre-push audit

  • az bicep build infra/main-shared.bicep — clean ✅
  • az bicep build infra/modules/shared.bicep — clean ✅
  • Identity: Jim Keeley <94459922+jkeeley2073@users.noreply.github.com>
  • No production code changed — infra + scripts only ✅

Operator tasks still needed (not in this PR)

  • B3: Create GitHub OIDC federated credential in Entra for Early-Bird-Solutions-LLC/PinballWizard repo + main branch (needed before A2 deploy.yml can authenticate)
  • B1+B2: Cloudflare DNS + WAF (parallel, no code dependency)

🤖 Generated with Claude Code

infra/modules/shared.bicep:
- Add wizardImageTag + apiImageTag params (default: quickstart placeholder;
  CI/CD always supplies explicit :{sha} tags — never :latest for deploys)
- Add apiContainerAppName var ('pinwiz-ca-api-{env}')
- Add apiApp ACA resource: internal ingress (port 8080, external=false),
  minReplicas=0 / maxReplicas=3, system-assigned MI, same env var pattern
  as wizardApp (ASPNETCORE_URLS, ENVIRONMENT, APPLICATIONINSIGHTS_CONNECTION_STRING)
- Add apiAppAcrPull role assignment (same AcrPull RBAC pattern as wizardApp)
- Add apiAppDiag diagnostic settings (AllMetrics → Log Analytics)
- Update wizardApp image from hardcoded placeholder → wizardImageTag param
- Add services__pinwiz-api__http__0 env var on wizardApp so Aspire service
  discovery resolves to the internal Api ACA app ('http://pinwiz-ca-api-{env}')
- Add wizardFqdn, apiContainerAppName, apiPrincipalId outputs

infra/main-shared.bicep:
- Wire wizardImageTag + apiImageTag params through to the shared module
- Add wizardContainerAppName, wizardPrincipalId, wizardFqdn, apiContainerAppName,
  apiPrincipalId outputs

infra/scripts/Deploy-SharedResources.ps1:
- Add optional -WizardImageTag and -ApiImageTag params
- Auto-discover current image from running ACA app when not supplied so
  a manual Bicep re-deploy does not revert the image to placeholder
- Pass both image tags as inline params to az stack sub create
@jkeeley2073 jkeeley2073 added the claude-code Generated with Claude Code label May 15, 2026
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
PinballWizard.Application 88% 81% 1184
PinballWizard.Web 74% 72% 513
PinballWizard.Api 84% 73% 69
PinballWizard.Infrastructure 66% 67% 1856
PinballWizard.Core 77% 100% 62
Summary 74% (7602 / 10238) 73% (2455 / 3367) 3684

Minimum allowed line rate is 70%

@jkeeley2073 jkeeley2073 merged commit 39f92b5 into main May 15, 2026
9 checks passed
@jkeeley2073 jkeeley2073 deleted the Dev-Phase7-A0 branch May 15, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-code Generated with Claude Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant