Skip to content

feat: azure deployment adapter#317

Merged
lazarv merged 4 commits intomainfrom
feat/adapter-azure
Mar 1, 2026
Merged

feat: azure deployment adapter#317
lazarv merged 4 commits intomainfrom
feat/adapter-azure

Conversation

@lazarv
Copy link
Owner

@lazarv lazarv commented Mar 1, 2026

This PR introduces two new deployment adapters for Azure, enabling @lazarv/react-server applications to be deployed to Azure cloud infrastructure.

New Adapters

azure — Azure Function App

A full-featured Azure deployment adapter (packages/react-server/adapters/azure/) that:

  • Provisions Azure resources automatically via the Azure CLI and Bicep infrastructure-as-code templates: resource group, storage account, App Service Plan, and Function App.
  • Derives the app name from package.json when not explicitly configured.
  • Copies static assets and server bundles into a .azure/ output directory with the correct structure expected by Azure Functions.
  • Supports both creating new resources and deploying to existing ones.
  • Exposes safe wrappers (az, azSafe, azJSON) for Azure CLI calls with structured error reporting.

azure-swa — Azure Static Web Apps

A lightweight adapter (packages/react-server/adapters/azure-swa/) targeting Azure Static Web Apps with:

  • An edge build strategy — bundles the server into a single file via a custom entry.mjs.
  • Generates an Azure Functions v3-compatible wrapper that bridges the (context, req) invocation model to the standard fetch-based handler, including x-ms-original-url / x-forwarded-proto / x-forwarded-host support.
  • Outputs into .azure-swa/ with static/ and functions/ subdirectories matching SWA's expected layout.
  • Writes a staticwebapp.config.json for routing/navigation fallback configuration.

Other Changes

  • create-react-server wizard — both azure and azure-swa are now selectable deployment targets in the interactive deploy step.
  • Core adapter (core.mjs, core.d.ts) — minor extensions to support the new adapters (output directory handling, type exports).
  • Output directory fix — corrected outDir handling across the bun, cloudflare, deno, and netlify adapters for consistency with the new convention.
  • Documentation:
    • Added full deploy guides for Azure and Azure Static Web Apps.
    • Added a new AdapterGrid component for the adapter index page.
    • Updated the adapter index pages (EN + JA) and the adapter API reference.
    • Added .gitignore entries for .azure and .azure-swa build output directories.

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
react-server-docs d54e88f Mar 01 2026, 01:44 PM

@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2026

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
345 3 342 0
View the top 3 failed test(s) by shortest run time
__test__/deno.spec.mjs > create-react-server: deno runtime (npm) > preset: blank > starts in production mode
Stack Traces | 0.000952s run time
AssertionError: production start should work: expected false to be true // Object.is equality

- Expected
+ Received

- true
+ false

 ❯ __test__/deno.spec.mjs:74:66
__test__/deno.spec.mjs > create-react-server: deno runtime (npm) > preset: blank > builds the app
Stack Traces | 0.00136s run time
AssertionError: build should succeed: expected false to be true // Object.is equality

- Expected
+ Received

- true
+ false

 ❯ __test__/deno.spec.mjs:70:58
__test__/deno.spec.mjs > create-react-server: deno runtime (npm) > preset: blank > dev mode starts and serves the app
Stack Traces | 0.00949s run time
AssertionError: dev mode should work: expected false to be true // Object.is equality

- Expected
+ Received

- true
+ false

 ❯ __test__/deno.spec.mjs:66:56

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@lazarv lazarv merged commit fd6d426 into main Mar 1, 2026
65 of 66 checks passed
@lazarv lazarv deleted the feat/adapter-azure branch March 1, 2026 14:43
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.

2 participants