fix: Azure pipeline config and Bicep correctness fixes (prelaunch prep)#22
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_CONNECTIONwith separateAZURE_SERVICE_CONNECTION_STAGINGandAZURE_SERVICE_CONNECTION_PRODvariables. 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_URLandFRONTEND_URLwere not injected into the AI service app settings in Bicep, so FastAPI's CORSallow_originswould have defaulted tohttp://localhost:3000/3001in production — rejecting all real traffic.Add missing Bicep app settings:
JWT_EXPIRATION,JWT_REFRESH_EXPIRATION, andHUGGINGFACE_API_KEYwere 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_KEYtoseed-keyvault.shanddeploy-env.ymlso 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). RenameSTRIPE_PUBLISHABLE_KEY→NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYso Next.js exposes it to the browser.