How do I deploy a Next.js app to Azure App Service?
posée 21 days ago159 vuesen
I want to deploy a Next.js 15 app (App Router) to Azure App Service, not Vercel.
What's the right Node runtime setting, and how do I handle the standalone output and environment variables?
🤖 Diagnostic IA
Généré par IA. Ce n'est pas une réponse — la communauté ci-dessous le confirme ou le corrige. Vérifiez toujours avant de vous y fier.
3 réponses
In 2026, uv is the fastest and simplest: uv venv, uv pip install, and a pyproject.toml + uv.lock committed. It replaces pip/venv/pip-tools and is compatible with Poetry-style metadata.
Connectez-vous pour dire si ça a marché.
Set output: 'standalone' in next.config, deploy the .next/standalone folder, and set the App Service startup command to node server.js. Use WEBSITE_NODE_DEFAULT_VERSION = ~20 and configure env vars under Configuration → Application settings.
Connectez-vous pour dire si ça a marché.
Don't call setState in map. Compute the derived value directly:
const total = items.reduce((s, i) => s + i.price, 0);
If you truly need state, set it once in an effect with the computed result, not per iteration.
Connectez-vous pour dire si ça a marché.
Sign in and verify your email to post an answer.