Skip to content

Instantly share code, notes, and snippets.

@kongou-ae
Created December 22, 2017 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kongou-ae/3f5a8c97cd2a3d40013f2fd0492f75ad to your computer and use it in GitHub Desktop.
Save kongou-ae/3f5a8c97cd2a3d40013f2fd0492f75ad to your computer and use it in GitHub Desktop.
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 43
---

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!

{{}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment