Depreciation warning does not allow deploying an A

2019-08-27 06:21发布

问题:

I get the following warning while deploying my application to AZURE.

(node:6568) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead.

But this does not allow my application to start. Azure logs show the following thing:

PATH OF LOGS: D:\home\LogFiles\Application>

回答1:

I know this question is already 8 month old, but just for completeness I am going to provide the answer on how to suppress warnings for Node in Azure. There is actually multiple ways:

Using iisnode.yml

Just put the following line in the iisnode.yml:

nodeProcessCommandLine: node.exe --no-deprecation --no-warnings

Or if you use a full path to a version of Node, you'll need to quote it, e.g.

nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\10.6.0\node.exe" --no-deprecation --no-warnings

Using web.config

Toward the end of the file, you'll see a commented out tag. Replace it by something like this:

<iisnode nodeProcessCommandLine="node.exe --no-deprecation --no-warnings"/>

Notes

iisnode.yml takes precedence over web.config

See the original post on how to add runtime flags in Azure here: Pass flags to NodeJS's Chrome V8 engine in Azure Web Apps