kongou-ae
12/22/2017 - 2:57 PM

transrated.md


Title: author Azure Function uses deferral: ongou_ye

date: 2017-12-14 url: /archives/2017-12-14-using-asyncawait-on-azure-function categories:

  • Azure

At first

The default Azure Funtion not async/await. The version of node.js is v6.5.0. It is, but you can use deferral in the Azure Funtion if you change settings. Freed from the hell of the callback.

However, this procedure is 12/15 use the preview feature at the time. Please note that.

Procedure

change the settings of the following is required to use a deferral.

  1. Change the runtime version in Beta
  2. Change the environment variable 'WEBSITE_NODE_DEFAULT_VERSION' to the 8.5.0

{{}}

{{}}

Operation check

V6.5.0's async point will fail.

{{}}

When you switch to v8.5.0 interprets the deferral. part of the async error. to go to sleep and not await, wait for 10 seconds.

{{}}

Reference: [in ES2017 async/await sleep to write the process] (https://qiita.com/asa-taka/items/888bc5a1d7f30ee7eda2)

go to sleep to await and wait 10 seconds. I'm async/await. Great!

{{}}