Its possible deploy a hybrid NEXT.js application in Azure?

161 Views Asked by At

I'm trying to deploy a Next.js application who uses client and server components and also serve functions, however, when I try to deploy to Azure just don't work. The closest I came was on Static web apps and the pages were bugged, next auth didn't work, etc. Is there a way to do this correctly? I took care of the edge functions

1

There are 1 best solutions below

0
Ziyang Liu-MSFT On BEST ANSWER

Next.js hybrid support in Azure Static Web Apps is in preview. During the preview, the following features of Static Web Apps are unsupported for Next.js with server-side rendering:

  • APIs using Azure Functions, Azure AppService, Azure Container Apps or Azure API Management.
  • Deployment via the SWA CLI.
  • Static Web Apps provided Authentication and Authorization. - Instead, you can use the Next.js Authentication feature.
  • The staticwebapp.config.json file. - Features such as custom headers and routing can be controlled using the next.config.js file.
  • skip_app_build and skip_api_build can't be used.
  • Incremental static regeneration (ISR) does not support caching images and on-demand revalidation
  • Next.js versions 13 and above have limited support for hybrid-rendering. Static HTML export is fully supported.

You can check whether your website requires features that are not currently supported. See the official doc Deploy hybrid Next.js websites on Azure Static Web Apps (Preview) for more detailed info.