![](/img/trans.png)
[英]Azure Functions with timer trigger: UnscheduledInvocationReason
[英]Azure Functions Timer Trigger not working
我的規格:
是的,我已經使用@beta
安裝了VS Code Azure Functions擴展和CLI
工具。
所以,我做了func new --language JavaScript --template TimerTrigger --name testfunc
輸出:
Select a language: JavaScript
Select a template: TimerTrigger
Function name: [TimerTriggerJS] Writing C:\Users\user\code\azure\functions\testfunc\index.js
Writing C:\Users\user\code\azure\functions\testfunc\readme.md
Writing C:\Users\user\code\azure\functions\testfunc\sample.dat
Writing C:\Users\user\code\azure\functions\testfunc\function.json
然后我在終端中執行func host start --debug vscode
,我得到:
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
[11/29/2017 8:19:39 PM] Reading host configuration file 'C:\Users\user\code\azure\functions\host.json'
[11/29/2017 8:19:39 PM] Host configuration file read:
[11/29/2017 8:19:39 PM] {}
info: Worker.Node.0586fcbb-0c58-48e1-a02e-b0644ace851a[0]
Start Process: node --inspect=5858 "C:\Users\user\.azurefunctions\bin\workers\node\dist\src\nodejsWorker.js" --host 127.0.0.1 --port 57233 --workerId 0586fcbb-0c58-48e1-a02e-b0644ace851a --requestId 06b7578c-e1ec-456c-83ee-4c26ce8b9ca3
[11/29/2017 8:19:39 PM] Generating 2 job function(s)
[11/29/2017 8:19:39 PM] Starting Host (HostId=swlaptop2062-377256582, Version=2.0.11370.0, ProcessId=19932, Debug=True, ConsecutiveErrors=0, StartupCount=0, FunctionsExtensionVersion=)
[11/29/2017 8:19:39 PM] Found the following functions:
[11/29/2017 8:19:39 PM] Host.Functions.TriggerHR
[11/29/2017 8:19:39 PM] Host.Functions.testfunc
[11/29/2017 8:19:39 PM]
info: Worker.Node.0586fcbb-0c58-48e1-a02e-b0644ace851a[0]
Debugger listening on ws://127.0.0.1:5858/9e2f7545-9199-4988-b1eb-12d54f999142
info: Worker.Node.0586fcbb-0c58-48e1-a02e-b0644ace851a[0]
For help see https://nodejs.org/en/docs/inspector
Listening on http://localhost:7071/
Hit CTRL-C to exit...
info: Worker.Node.0586fcbb-0c58-48e1-a02e-b0644ace851a[0]
Worker 0586fcbb-0c58-48e1-a02e-b0644ace851a connecting on 127.0.0.1:57233
launch.json for VSCode configured.
[11/29/2017 8:19:40 PM] Job host started
[11/29/2017 8:19:44 PM] Host lock lease acquired by instance ID '000000000000000000000000FFD4EE60'.
因此,當我通過POSTMAN http://localhost:7071/admin/functions/testfunc
,我希望調試器啟動並且我的函數可以運行,但是什么也沒有發生。
我在瀏覽器上轉到http://localhost:7071
,它可以工作。 我轉到http://localhost:7071/admin/functions/testfunc
,但未找到404。
我究竟做錯了什么? 我以為我在遵循所有正確的步驟。
通過增加
{
"input": ""
}
在請求的主體中,我能夠使調用和調試器正常工作。 是的 這就是所有缺少的東西。 現在,我的VSCode調試器可以工作了:-)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.