To deploy your Next.js dashboard (with App Router) to Azure App Service, follow these steps.
Azure supports Next.js out-of-the-box with static and server-rendered content, including middleware.
microsoft/copilot-metrics-dashboard
>>C:\copilot-metrics-dashboard\src\dashboard>
1. Prepare Your App for Azure, Ensure your app is ready:
package.json must have a build and start script:
{
You're using App Router (e.g., app/page.tsx), so next build will generate both static and server-rendered routes.
2. Create Production Build (Locally or via CI), run through VSC
npm install
npm run build
npm start - This confirms your app runs as a production server with next start.
Make sure the build completes successfully.