Missing Documentation for web.config for a Node.js application on Azure Website - azure

I'm running a Node.js server as API for my mobile app on a Windows Azure Website. And I'm having some trouble with it due to the needed web.config - but I couldn't find any really helpful documentation about it. Everything I can find is googling for specific problems on it and with a bit luck I can use the config snippets.
is there any general documentation about the contents the web.config can contain and their meaning?
in the start I had the problem that errors were modified by IIS to a general error. But since it's a REST API I want the HTTP status codes to be returned. I got around that with the <httpErrors existingResponse="PassThrough" /> element, but it doesn't seem to work for every error.
The only documentation I found so far are example configuration files of the iisnode module.

If you see the following error:
web.config not found in project, to create a project to deploy to
Windows Azure you must create a Windows Azure Node.js project.
....you may have created the wrong type of Visual Studio Project. You want a "Windows Azure Node.js Application" not a "Node.js Web Application". The former creates a few extra files that are needed for Azure (Web.cloud.config & Web.config).
You may be able to create a dummy VS project of the correct type and then copy these files into your existing project. Alternatively create a new project of the correct type and copy your source files into the new project.

Create Azure Basic Node.js Express Application

Related

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

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.

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.

Azure Web Deploy "Could not find a part of the path 'D:\home\site\wwwroot\bin\roslyn\csc.exe'."

I've been browsing the web for a couple hours now looking for an answer to my problem. I am trying to deploy a Web API on Azure Web App Service using VS2017. Everything builds and works fine when running locally but once deployed on Azure (through VS2017) I get this error:
D:\home\site\wwwroot\bin\roslyn\csc.exe
My project is an ASP.NET Web Application (Using Azure Web API template) .NET Framework 4.6.1. I use Microsoft.CodeDom.Providers.DotNetCompilerPlatform Version=1.0.6.0
I also made sure that csc.exe is located in:
Visual Studio 2017\Projects\DeviceManagementAPI\DeviceManagementAPI\bin\roslyn
Just had the same problem and it seems it's a known issue with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.6 and 1.0.7.
Downgrading to 1.0.5 solves the problem.
Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 1.08 worked for me
After a while I simply uploaded manually the roslyn file directly into the server through Kudu. It seems to solve the problem but I still don't know why it won't upload automatically.
Same issue might be caused by missing or incorrect relative packages path. If you're changing solution folder structure make sure all imports have proper path's to avoid missing Roslyn files.
Generally suggest to replace auto-generated ../../../packages/... rabit hole with parameter which will point to correct Nuget folder.
<Import Project="$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />

System.TypeLoadException on Azure App Service

I'm running an asp.net 4.6 app on the app service. Just removed mvc from the site and using url rewrite to run an mvc free angular spa with a webapi.
Now it's asking for a type that was renamed months ago and works in pre mvc removal builds. I don't think it's got something to do with mvc though.
In trying to solve this I've xeroxed my local bin folder onto the server and the error still persists. So some sort of server config?
Has anyone ever experienced this before?
The error means that you are using a type which is not found in your assembly. To troubleshoot this issue, you need to find where you used this type. I suggest you use the Find in files feature provided by Visual Studio by pressing Ctrl+Shift+F. After found the place which used the type, you just need to delete it and rebuild your application.

Azure: Application Insights. Are the ai.x.xx.x-buildxxxxx.js file required?

After enabling Application Insights on my MVC web app I see that a file called ai.0.22.8-build00154.js was added to the /Scripts folder (however, it was not included to the .csproj).
In addition I do not see this file referenced anywhere in the project.
When I run the web app I do see data being sent to my Application Insights instance on Azure.
* Question *
Is this javascript file even required?
Note that I do have the script snippet at the end of the section (per App. Insights documentation).
This file is not required. It is included in case you decide to host Application Insights JS SDK yourself and not use the hosted version on CDN (http://az416426.vo.msecnd.net/scripts/a/ai.0.js). The snippet is referencing this version, so in case you decide to host AI JS SDK script yourself, you also need to update the snippet.
It is recommended that you are referencing the version on the CDN as this is the way to get all the latest updates automatically.
Yes I believe it is required, it's the Nuget package. The filename you have up there seems to match up with the package.

Resources