{"id":46574976,"url":"https://github.com/zpg6/opennextjs-azure","last_synced_at":"2026-03-07T09:31:13.283Z","repository":{"id":321296797,"uuid":"1085038756","full_name":"zpg6/opennextjs-azure","owner":"zpg6","description":"True serverless Next.js on Azure Functions with a Vercel-grade developer experience","archived":false,"fork":false,"pushed_at":"2025-12-09T01:24:44.000Z","size":2371,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-10T07:54:52.247Z","etag":null,"topics":["azure","azure-functions","nextjs","opennext","opennextjs","serverless"],"latest_commit_sha":null,"homepage":"https://opennext-basic-app-func-dev.azurewebsites.net/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zpg6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-28T14:00:41.000Z","updated_at":"2025-12-09T01:24:48.000Z","dependencies_parsed_at":"2025-10-28T23:23:53.517Z","dependency_job_id":"4eb5d15d-0013-4336-8b83-cd26e9a2c205","html_url":"https://github.com/zpg6/opennextjs-azure","commit_stats":null,"previous_names":["zpg6/opennextjs-azure"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zpg6/opennextjs-azure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Fopennextjs-azure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Fopennextjs-azure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Fopennextjs-azure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Fopennextjs-azure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zpg6","download_url":"https://codeload.github.com/zpg6/opennextjs-azure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpg6%2Fopennextjs-azure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30210829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-functions","nextjs","opennext","opennextjs","serverless"],"created_at":"2026-03-07T09:31:11.162Z","updated_at":"2026-03-07T09:31:12.630Z","avatar_url":"https://github.com/zpg6.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenNext.js Azure\n\n**True serverless Next.js on Azure Functions** (EXPERIMENTAL)\n\n[![NPM Version](https://img.shields.io/npm/v/opennextjs-azure)](https://www.npmjs.com/package/opennextjs-azure)\n[![NPM Downloads](https://img.shields.io/npm/dt/opennextjs-azure)](https://www.npmjs.com/package/opennextjs-azure)\n[![License: MIT](https://img.shields.io/npm/l/opennextjs-azure)](https://opensource.org/licenses/MIT)\n\nBuilt on the [OpenNext](https://opennext.js.org) framework, this adapter brings native Next.js support to Azure Functions with a Vercel-grade developer experience.\n\n![Deploy Screenshot](./docs/deploy-screenshot.png)\n\n\u003e **🚀 New to Azure deployment?** Jump to [Quick Start](#quick-start) and run `npx opennextjs-azure@latest init --scaffold` to create a fully configured Next.js app on Azure in seconds!\n\n## The Gap This Project Fills\n\nTutorials exist for static Next.js on Static Web Apps, standalone builds on App Service, and Docker-based deployments, but nothing for **true serverless Next.js on Azure Functions** with ISR, streaming SSR, and on-demand revalidation—until now.\n\nAzure Functions is Microsoft's serverless compute platform—comparable to AWS Lambda and Cloudflare Workers, both of which already have OpenNext adapters. This project bridges that gap, bringing the same Vercel-grade developer experience to Azure: one command deploys your Next.js app with all the infrastructure you need.\n\n## Next.js Features → Azure Services\n\n| Next.js Feature                        | Azure Implementation                                            |\n| -------------------------------------- | --------------------------------------------------------------- |\n| Incremental Static Regeneration        | Azure Blob Storage                                              |\n| Image Optimization                     | Azure Blob Storage with automatic caching                       |\n| Streaming SSR                          | Azure Functions with Node.js streams                            |\n| `revalidateTag()` / `revalidatePath()` | Azure Table Storage + Queue Storage                             |\n| Fetch caching                          | Azure Blob Storage with build ID namespacing                    |\n| Monitoring \u0026 Logging                   | Azure Application Insights (optional, enabled by default)       |\n| Infrastructure                         | Azure Bicep templates upsert infrastructure in a resource group |\n\n## Quick Start\n\n### ⚡ Recommended: Create New Project with Scaffold\n\n**The fastest way to get started** is using our scaffold command, which wraps `create-next-app` and sets up everything for Azure deployment:\n\n```bash\nnpx opennextjs-azure@latest init --scaffold\n```\n\nThis single command:\n\n1. Creates a new Next.js 15 app (TypeScript, App Router, Tailwind, ESLint)\n2. Adds Azure deployment dependencies (`opennextjs-azure`, `esbuild`)\n3. Configures `next.config.ts` with `output: \"standalone\"`\n4. Creates `open-next.config.ts` with Azure adapters\n5. Generates `infrastructure/main.bicep` for Azure resources\n6. Sets up `azure.config.json` for deployment configuration\n\nThen build and deploy:\n\n```bash\nnpx opennextjs-azure build\nnpx opennextjs-azure deploy\n```\n\n**💡 See it in action:** The [`examples/basic-app`](./examples/basic-app) directory (live at https://opennext-basic-app-func-dev.azurewebsites.net) was created using `init --scaffold` with zero manual configuration!\n\n### 📦 Adding to Existing Project\n\nIf you have an existing Next.js project:\n\n```bash\n# Initialize Azure infrastructure\nnpx opennextjs-azure init\n\n# Build for Azure\nnpx opennextjs-azure build\n\n# Deploy (provisions infrastructure + deploys app)\nnpx opennextjs-azure deploy\n\n# View live logs in Azure Portal\nnpx opennextjs-azure tail\n```\n\n## Intelligent Preflight Checks\n\nBefore deployment, the CLI validates your Azure environment to prevent failed deployments:\n\n✓ **Azure CLI** installation and login status  \n✓ **Subscription** permissions and state  \n✓ **Region** availability  \n✓ **Resource providers** (auto-registers Microsoft.Quota, Microsoft.Storage, Microsoft.AlertsManagement, etc.)  \n✓ **Quota availability** for your target SKU  \n✓ **Build output** structure\n\n**Smart quota handling:** If you request `--environment prod` but don't have EP1 Premium quota, the CLI suggests `--environment dev` instead. Zero failed deployments from quota issues.\n\n## Architecture\n\n```\nNext.js Request\n    ↓\nAzure Functions HTTP Trigger\n    ↓\nAzure HTTP Converter (request → InternalEvent)\n    ↓\nAzure Functions Wrapper (handles streaming)\n    ↓\nNext.js Server (OpenNext)\n    ↓\nISR Cache Check → Azure Blob Storage\nTag Check → Azure Table Storage\nRevalidation → Azure Queue Storage\n    ↓\nResponse Stream → Azure Functions Response\n```\n\n## One Command, Full Infrastructure\n\n`opennextjs-azure deploy` provisions everything via Bicep:\n\n- Function App (with streaming support)\n- Storage Account (blob containers, tables, queues)\n- App Service Plan (Y1 Consumption or EP1 Premium)\n- Application Insights (optional, for monitoring and logging)\n- CORS configuration\n- Environment variables\n- Connection strings\n\n![Resource Group Screenshot](./docs/rg-screenshot.png)\n\nChoose your environment:\n\n- `--environment dev` → Y1 Consumption (pay-per-execution)\n- `--environment staging` → EP1 Premium (always-ready instances)\n- `--environment prod` → EP1 Premium (production-grade)\n\n## How It Works\n\n**Protocol Adapters:**  \nConverts between Azure Functions HTTP triggers and Next.js InternalEvent/InternalResult format with full streaming support.\n\n**ISR Implementation:**\n\n- **Incremental Cache:** Azure Blob Storage stores rendered pages with `[buildId]/[key].cache` structure\n- **Tag Cache:** Azure Table Storage maps tags → paths for `revalidateTag()`\n- **Revalidation Queue:** Azure Queue Storage triggers on-demand regeneration\n\n**Image Optimization:**\n\n- **Source Images:** Loaded from `assets` blob container\n- **Optimized Cache:** Processed images cached in `optimized-images` container to avoid re-processing\n- **Processing:** Processing is done with the `sharp` library, which gets added for you during deployment.\n\n**Build Process:**  \nUses OpenNext's AWS build with Azure-specific overrides, then adds Azure Functions metadata (`host.json`, `function.json`) for v3 programming model.\n\n## CLI Commands\n\n### `init --scaffold` (Recommended for new projects)\n\nCreates a complete Next.js + Azure setup in one command:\n\n```bash\nnpx opennextjs-azure@latest init --scaffold\n```\n\nThis wraps `create-next-app` with Azure-specific setup. Supports all create-next-app options:\n\n```bash\n# Customize the scaffold\nopennextjs-azure init --scaffold \\\n  [--no-typescript] \\\n  [--no-tailwind] \\\n  [--no-eslint] \\\n  [--no-src-dir] \\\n  [--no-app-router] \\\n  [--import-alias \u003calias\u003e] \\\n  [--package-manager npm|yarn|pnpm|bun]\n```\n\n### Other Commands\n\n```bash\n# Initialize Azure infrastructure in existing project\nopennextjs-azure init\n\n# Build Next.js app for Azure\nopennextjs-azure build [-c \u003cconfig-path\u003e]\n\n# Deploy to Azure\nopennextjs-azure deploy \\\n  [--app-name \u003cname\u003e] \\\n  [--resource-group \u003cname\u003e] \\\n  [--location \u003cregion\u003e] \\\n  [--environment dev|staging|prod] \\\n  [--skip-infrastructure] \\\n  [--skip-resource-checks]\n\n# View live logs in Azure Portal\nopennextjs-azure tail \\\n  [--app-name \u003cname\u003e] \\\n  [--resource-group \u003cname\u003e]\n\n# Check deployment health\nopennextjs-azure health \\\n  [--app-name \u003cname\u003e] \\\n  [--resource-group \u003cname\u003e]\n\n# Delete resource group and all resources\nopennextjs-azure delete \\\n  [--resource-group \u003cname\u003e] \\\n  [--yes] \\\n  [--no-wait]\n```\n\n## License\n\n[MIT](./LICENSE)\n\n## Contributing\n\nContributions are welcome! Whether it's bug fixes, feature additions, or documentation improvements, we appreciate your help in making this project better. For major changes or new features, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpg6%2Fopennextjs-azure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzpg6%2Fopennextjs-azure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpg6%2Fopennextjs-azure/lists"}