Ich habe einen timerTrigger
, die ich auf VS-Code lokal debuggen wollen, so dass ich die func host start --debug vscode
auf der Wurzel, wo host.json
ist:Azure Funktionen Trigger-Timer-Trigger lokal
PS C:\Users\user\code\azure\functions> func host start --debug vscode
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
[11/28/2017 10:21:30 PM] Reading host configuration file 'C:\Users\user\code\azure\functions\host.json'
[11/28/2017 10:21:30 PM] Host configuration file read:
[11/28/2017 10:21:30 PM] {}
info: Worker.Node.1b2b2430-8e1c-4d66-a3e9-bb1672be5ac2[0]
Start Process: node --inspect=5858 "C:\Users\user\.azurefunctions\bin\workers\node\dist\src\nodejsWorker.js" --host 127.0.0.1 --port 59865 --workerId 1b2b2430-8e1c-4d66-a3e9-bb1672be5ac2 --requestId f52eeb9b-d46b-4791-8504-3f94f380c1e2
[11/28/2017 10:21:31 PM] Generating 1 job function(s)
[11/28/2017 10:21:31 PM] Starting Host (HostId=swlaptop2062-377256582, Version=2.0.11370.0, ProcessId=16752, Debug=True, ConsecutiveErrors=0, StartupCount=0, FunctionsExtensionVersion=)
[11/28/2017 10:21:31 PM] Found the following functions:
[11/28/2017 10:21:31 PM] Host.Functions.TriggerHR
[11/28/2017 10:21:31 PM]
info: Worker.Node.1b2b2430-8e1c-4d66-a3e9-bb1672be5ac2[0]
Debugger listening on ws://127.0.0.1:5858/77692ee0-e279-4463-9974-f8412f5dd3fd
info: Worker.Node.1b2b2430-8e1c-4d66-a3e9-bb1672be5ac2[0]
For help see https://nodejs.org/en/docs/inspector
Listening on http://localhost:7071/
Hit CTRL-C to exit...
launch.json for VSCode configured.
info: Worker.Node.1b2b2430-8e1c-4d66-a3e9-bb1672be5ac2[0]
Worker 1b2b2430-8e1c-4d66-a3e9-bb1672be5ac2 connecting on 127.0.0.1:59865
[11/28/2017 10:21:32 PM] Job host started
[11/28/2017 10:21:32 PM] Host lock lease acquired by instance ID '000000000000000000000000EF9214DA'.
Dann ich func run TriggerHR
. Ich bekomme:
Error: unknown argument run
Azure Functions Core Tools (2.0.1-beta.21)
Function Runtime Version: 2.0.11370.0
Usage: func [context] [context] <action> [-/--options]
Hier ist die function.json
auf TriggerHR
ist:
{
"disabled": false,
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */30 * * * *"
}
]
}
Ich bin auf v2 Laufzeit. Ich versuche sogar http://localhost:7071/api/myTimer
und ich bekomme localhost cannot be found
, obwohl http://localhost:7071
mir das Smiley-Fenster gibt, dass meine App läuft.
Hier ist, wie es ist gelegt:
- TriggerHR (Timer function)
--index.js
--function.json
|
|
- host.json
- local.settings.json
1. ja, ich verwende die '@ core' Version. 2. Ja, ich habe das gelesen. 3. Ich verwende POSTMAN, um eine "POST" -Anforderung an "http: // localhost: 7071/admin/functions/myTimer" und "http: // localhost: 7071/admin/functions/TriggerHR" ohne Erfolg zu senden. 4. Ja, ich habe das installiert. – nn2
Was bedeutet "kein Glück"? Was ist der HTTP-Antwortcode? –
Doing 'curl --request POST -H" Inhaltstyp: application/json "http: // localhost: 7071/admin/functions/TriggerHR' gibt nichts zurück. Führen Sie es mit der Eigenschaft 'name' aus' function.json' aus? Für POSTMAN bekomme ich eine 400 Bad Request – nn2