Skip to content

fix(samples): map SWA-unsupported deploy regions so azd up doesn't fail on region - #24

Merged
Gregory Joseph (gnjoseph) merged 1 commit into
feat/spe-mcp-serverfrom
agents/pr3-swa-region-fix
Jul 9, 2026
Merged

fix(samples): map SWA-unsupported deploy regions so azd up doesn't fail on region#24
Gregory Joseph (gnjoseph) merged 1 commit into
feat/spe-mcp-serverfrom
agents/pr3-swa-region-fix

Conversation

@gnjoseph

Copy link
Copy Markdown
Collaborator

Problem

The react-spa-functions sample's infra/web.bicep pinned the Static Web App to the deploy location (= resource group location). Azure Static Web Apps is only available in a subset of regions, so a location that is valid for the resource group (e.g. eastus) is rejected for the SWA with "Static Web Apps aren't available in eastus".

Result: every azd up fails on the first attempt, and an agent driving the deploy has to notice the error, inspect the bicep, patch in a region mapping, and retry — inflating deploy time 2-3x and making it non-deterministic.

How it was found

Surfaced by the continuous SPA-deploy eval loop (internal control-plane repo) across repeated live runs: with location=eastus the agent hit Deploy failed: Static Web Apps aren't available in eastus and re-derived the same bicep fix on every run (project_deploy called 2-3x; ~388-624s end-to-end).

Fix

Map an unsupported deploy region to a supported nearby region (eastus2) for the Static Web App resource only — the resource group still uses the requested location. One-line-of-logic, defensive, and matches the SWA availability docs.

  • bicep build compiles clean.
  • reference-architectures.test.ts (16 tests) pass (those cover the C# sample; this change is isolated to the React sample's web.bicep).

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The react-spa-functions sample's infra/web.bicep pinned the Static Web App to
the deploy location (= resource group location). When that region is one
Static Web Apps does not support (e.g. eastus), \�zd up\ fails with
'Static Web Apps aren't available in <region>', so every deploy fails on the
first attempt and the agent has to inspect and patch the bicep before retrying
— inflating deploy time 2-3x and making it non-deterministic.

Map an unsupported region to a supported nearby one (eastus2) for the Static
Web App resource only; the resource group stays in the requested region. This
was surfaced by the continuous SPA-deploy eval loop across repeated runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gnjoseph
Gregory Joseph (gnjoseph) merged commit 1b75869 into feat/spe-mcp-server Jul 9, 2026
5 checks passed
@gnjoseph
Gregory Joseph (gnjoseph) deleted the agents/pr3-swa-region-fix branch July 9, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant