Skip to content

fix: Azure pipeline config and Bicep correctness fixes (prelaunch prep)#22

Merged
dewitt4 merged 1 commit into
mainfrom
task/azure-verification
Jun 19, 2026
Merged

fix: Azure pipeline config and Bicep correctness fixes (prelaunch prep)#22
dewitt4 merged 1 commit into
mainfrom
task/azure-verification

Conversation

@dewitt4

@dewitt4 dewitt4 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Pre-work for workitem #7 (Prelaunch Verification). Fixes several correctness issues found during pipeline and infrastructure review before the first Azure deployment.

  • Split service connections: Replace single AZURE_SERVICE_CONNECTION with separate AZURE_SERVICE_CONNECTION_STAGING and AZURE_SERVICE_CONNECTION_PROD variables. Each is scoped to its own resource group only, limiting blast radius if either is compromised. The prod connection uses explicit pipeline authorization (not "grant all pipelines").

  • Fix AI service CORS bug: CORE_API_URL and FRONTEND_URL were not injected into the AI service app settings in Bicep, so FastAPI's CORS allow_origins would have defaulted to http://localhost:3000/3001 in production — rejecting all real traffic.

  • Add missing Bicep app settings: JWT_EXPIRATION, JWT_REFRESH_EXPIRATION, and HUGGINGFACE_API_KEY were read by the app but not set in Azure, causing silent fallback to hardcoded defaults and HuggingFace keys never reaching the AI service.

  • Wire HuggingFace through the pipeline: Added HUGGINGFACE_API_KEY to seed-keyvault.sh and deploy-env.yml so it flows from the variable group through Key Vault to the AI service app settings.

  • Fix .env.example: Document all Azure-specific variables that were missing (POSTGRES_SSL, REDIS_TLS, AZURE_STORAGE_*, CORE_API_URL). Rename STRIPE_PUBLISHABLE_KEYNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY so Next.js exposes it to the browser.

Pre-work for workitem #7 (Prelaunch Verification). Fixes several correctness
issues found during pipeline and infrastructure review before the first Azure
deployment.

- **Split service connections**: Replace single `AZURE_SERVICE_CONNECTION` with
  separate `AZURE_SERVICE_CONNECTION_STAGING` and `AZURE_SERVICE_CONNECTION_PROD`
  variables. Each is scoped to its own resource group only, limiting blast radius
  if either is compromised. The prod connection uses explicit pipeline authorization
  (not "grant all pipelines").

- **Fix AI service CORS bug**: `CORE_API_URL` and `FRONTEND_URL` were not injected
  into the AI service app settings in Bicep, so FastAPI's CORS `allow_origins`
  would have defaulted to `http://localhost:3000/3001` in production — rejecting
  all real traffic.

- **Add missing Bicep app settings**: `JWT_EXPIRATION`, `JWT_REFRESH_EXPIRATION`,
  and `HUGGINGFACE_API_KEY` were read by the app but not set in Azure, causing
  silent fallback to hardcoded defaults and HuggingFace keys never reaching the
  AI service.

- **Wire HuggingFace through the pipeline**: Added `HUGGINGFACE_API_KEY` to
  `seed-keyvault.sh` and `deploy-env.yml` so it flows from the variable group
  through Key Vault to the AI service app settings.

- **Fix `.env.example`**: Document all Azure-specific variables that were missing
  (`POSTGRES_SSL`, `REDIS_TLS`, `AZURE_STORAGE_*`, `CORE_API_URL`). Rename
  `STRIPE_PUBLISHABLE_KEY` → `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY` so Next.js
  exposes it to the browser.
@dewitt4 dewitt4 self-assigned this Jun 19, 2026
@dewitt4 dewitt4 added the enhancement New feature or request label Jun 19, 2026
@dewitt4 dewitt4 merged commit ad8680c into main Jun 19, 2026
1 of 5 checks passed
@dewitt4 dewitt4 deleted the task/azure-verification branch June 19, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant