500 error when I try to deploy nextjs ssg application with incremental-static-generation - azure

I have NextJS app with SSG. This functionality was added recently and according to it I should do next-export after next-build to get static files. But after appearing in 9.4 of Incremental Static Regeneration I need to keep server on by npm-start command (in my case I use custom server file with next-express functionality). It works good locally and It works good when I get artifact from Azure. But It doesn't work globally when it will be deployed finally. Help please

Through my attempts, I found that it is impossible to install globally or use next in Azure Web App. That is, it cannot be deployed through Github.Deploying using other methods such as FTP cannot run successfully. It should be related to the azure node environment.
But the method provided in this post says that it can be processed by adding web.config. I think it should be useful and helpful to you. Please read it carefully and try it.
You also can read this document, maybe it useful to you.

Related

Cannot deploy Node js app to Azure ("do not have permission")

I have a Wordle-esque app that I want to deploy using Azure. Repo here. It is a fork from a popular open-source project, and I can also locally build and run the game. Locally, it runs perfectly.
I am trying to use Azure App Services to deploy it, using a Github Action. All the Actions pass, and the App can be successfully built. However, when I try to view the deployment here the only error I am receiving is
You do not have permission to view this directory or page.
Since it runs locally, and it pass its github action build, I do not know how to proceed here. I have tried restarting the app, and changing the resources I am using to host it, but that does not work. Some other answers seem to suggest the problem is about it not finding index.html, but I can access that through https://shetland-wordle.azurewebsites.net/public/index.html and the page is blank.
If i look under wwwroot/ in the Azure debugger I see the following file structure:
Any help would be appreciated
turns out it was something strange with package.json. I needed to change the path to my react scripts:
"start": "node_modules/react-scripts/bin/react-scripts.js start"
Not sure if its good practise to do this, but it works now

Deployed Nodejs service does not work on Azure Web App

I've created two pipelines: build and release for Nodejs app.
Here is the link to nodejs app repo: azure web service
Here is the tasks for build pipeline:
Here is the wwwroot folder structure:
So it is look like all required files are present.
Despite that, I'm constantly receiving:
You do not have permission to view this directory or page
I've tried to add web.config file, but it did not help.
I have front end application on same App service Plan and it works, so it is no way that I have bad service plan.
Do you have any suggestions?
Thanks a lot.
I was able to deploy my service only after using nodejs-docs-hello-world starter.
It is looks like web.config is a required file, btw, still did not find any meaningfull documentation for web.config.
Make sure your azure nodejs env support your js syntax (import from ...), in other case use webpack or typescript.
I'have found App Service Editor very helpful if you want to debug your code errors. See section Output.
I had a problem also with nodejs version, despite the fact I choosed node 12 tls during web app creation, I have noticed that my app used node 6 under the hood. So I changed default nodejs version to 10. See here how to do it
Also, I want to thank #Jason Pan for his help.

How to recover source code of Nodejs GAE project

I've an application which is deployed. I'd created simple get fetch services on cloud in a project and have deployed it. Unfortunately in confusion b/w the projects, I deleted the project. I can access the web service by fetching through urls but couldn't get the source code. Any help?
At the moment it's only possible to download Java, Python, PHP and Go application's source code.
What I can recommend you is to submit a Feature Request through this link asking for this feature also for Node.js. Also you may consider using Cloud Source Repositories, which is free and can help you mitigate this kind of issues in the future.

Reactjs with Azure

I have a problem, i have created webApp, using Nodejs 8.1, its operational. I uploaded my code using a zip file. I ran npm install and start (to test) in the kudu,cmd debug console, they both succeed. It's not a reactjs .Net application (not my choice ..). I still can't see my website, I have tested different web.config files,obviously not using then locally. Should I use a VM... I need ideas. I can go thru the directories if directoryBrowse enabled = True. So there is some kind of response ...
Oh boy I was sooo far off, I needed to build and upload the build.. I found the answer here. Here is the answer

Using Nodejs with IIS for REST service using Express

We're using Nodejs + Express to create a RESTful web service. During testing we kicked off the service via the command-line, i.e., node mim.js and and tested the service using http://server:9999/mim/GetEmployeeData and that works fine.
The node application lives in inetpub\wwroot\myapps\mim and we want to be able to access it like so:
http://apps.mydomain.com/mim/GetEmployeeData
We're not quite sure how to get this to work with IIS, however. Looking for some help with respect to this.
Thanks in advance!
See this Hosting node.js applications in IIS on Windows tutorial:
https://github.com/tjanczuk/iisnode
It explains many different scenarios and since you din't post a lot of details it's hard to give you a more detailed answer other than pointing you to a good documentation about the thing that you're trying to do.

Resources