LoginSignup
1
0

More than 1 year has passed since last update.

Azure Functionsのnodeでローカルで動かしアクセスすると「Microsoft.Azure.WebJobs.Script: Did not find any initialized language workers.」と出て落ちる

Posted at

現象

dotnetのコマンドラインからプロジェクトを作成し、ローカルで動かしてみるもレスポンスは返ってこず、

[2022-01-27T01:36:18.348Z] Host lock lease acquired by instance ID '0000000000000000000000008075DF07'.

Functions:

    HttpExample: [GET,POST] http://localhost:7071/api/HttpExample

For detailed output, run func with --verbose flag.
[2022-01-27T01:39:59.235Z] Executing 'Functions.HttpExample' (Reason='This function was programmatically called via the host APIs.', Id=6b911e52-02a6-4493-ba8b-953be86341b9)
[2022-01-27T01:40:43.719Z] Final functionDispatcher state: WorkerProcessRestarting. Initialization timed out and host is shutting down
[2022-01-27T01:40:43.757Z] Executed 'Functions.HttpExample' (Failed, Id=6b911e52-02a6-4493-ba8b-953be86341b9, Duration=44555ms)
[2022-01-27T01:40:43.757Z] System.Private.CoreLib: Exception while executing function: Functions.HttpExample. Microsoft.Azure.WebJobs.Script: Did not find any initialized language workers.

と出て、落ちる。

解決

nodeのバージョンは合わせる必要があった。
参照)
https://docs.microsoft.com/ja-jp/azure/azure-functions/functions-versions?tabs=in-process%2Cv4&pivots=programming-language-javascript#languages
3.x系では

GA (Node.js 14、12、10)

なので、nvmでv14を指定。
動くようになった。

(まだまだAzureの情報がネット上に少ない…)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0