Hello @IE,
We are sorry to hear you're facing this issue. can you please share the full error message and the Azure tutorial you are following?
Here are a few things you can try to resolve the "You do not have permission to view this directory or page" error when deploying a Next.js app to Azure Web App Service:
- Check the permissions on the App Service. Make sure the identity you are using to deploy has read/write access. You can check under Access Control in the portal.
- Enable Detailed Error Messages. This can be done in the Azure portal by going to
App Services -> Your Web App -> App Service logs
. Turn onDetailed Error Messages
or all of the logging options - Check that your Next.js app is building correctly and generating the static pages in the
.next
folder. The Web App service needs those static pages to serve the app. - Make sure you are deploying the
.next
folder along with your source code to Azure. The Web App service looks for the.next
folder to run the Next.js app. - In your
next.config.js
file, set theoutput
option tonext-azure
. This will optimize the build for Azure Web App service. - In the Azure portal, go to the Configuration section of your Web App and make sure your build settings are correct. Set the build mode to
Next.js
if it's not already. - Restart the Web App instance after deploying code changes. The new
.next
folder may not be picked up until a restart. Hope that helps. -Grace