Hi, I am trying to debug and develop locally a simple JavaScript timerTrigger function azure application but I am having trouble. I am trying to follow along this tutorial: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local
Investigative informationPlease provide the following:
- Timestamp:
- Function App name: testcenter123
- Function name(s) (as appropriate): noderepo
- Invocation ID:
- Region:
I have the application handled via a Git repo so it's on my local machine as well.
Provide the steps required to reproduce the problem:
Go to root level of function app and run (via powershell):
func host start --debug vscodeλ func host start --debug vscode %%%%%% %%%%%% @ %%%%%% @ @@ %%%%%% @@ @@@ %%%%%%%%%%% @@@ @@ %%%%%%%%%% @@ @@ %%%% @@ @@ %%% @@ @@ %% @@ %% %[10/16/2017 6:54:48 PM] Host has been specialized Listening on http://localhost:7071/ Hit CTRL-C to exit... [10/16/2017 6:54:48 PM] Reading host configuration file 'C:\Users\xxxxxxxx\code\test-repos\NodeRepo1\host.json' [10/16/2017 6:54:48 PM] Host configuration file read: [10/16/2017 6:54:48 PM] { } [10/16/2017 6:54:48 PM] Loaded custom extension 'BotFrameworkConfiguration' [10/16/2017 6:54:48 PM] Loaded custom extension 'SendGridConfiguration' [10/16/2017 6:54:48 PM] Loaded custom extension 'EventGridExtensionConfig' [10/16/2017 6:54:48 PM] Generating 0 job function(s) [10/16/2017 6:54:48 PM] Starting Host (HostId=laptop2062-1189224982, Version=1.0.11232.0, ProcessId=8180, Debug=False, Attempt=0) [10/16/2017 6:54:48 PM] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.). [10/16/2017 6:54:48 PM] Job host started [10/16/2017 6:54:48 PM] Executing HTTP request: { [10/16/2017 6:54:48 PM] "requestId": "b2d45bf0-1947-4ad7-a9cd-cdfa469d04d2", [10/16/2017 6:54:48 PM] "method": "GET", [10/16/2017 6:54:48 PM] "uri": "/" [10/16/2017 6:54:48 PM] } [10/16/2017 6:54:48 PM] Executed HTTP request: { [10/16/2017 6:54:48 PM] "requestId": "b2d45bf0-1947-4ad7-a9cd-cdfa469d04d2", [10/16/2017 6:54:48 PM] "method": "GET", [10/16/2017 6:54:48 PM] "uri": "/", [10/16/2017 6:54:48 PM] "authorizationLevel": "Anonymous" [10/16/2017 6:54:48 PM] } [10/16/2017 6:54:48 PM] Response details: { [10/16/2017 6:54:48 PM] "requestId": "b2d45bf0-1947-4ad7-a9cd-cdfa469d04d2", [10/16/2017 6:54:48 PM] "status": "OK" [10/16/2017 6:54:48 PM] } launch.json for VSCode configured. Debugger listening on [::]:5858 [10/16/2017 6:54:51 PM] Executing HTTP request: { [10/16/2017 6:54:51 PM] "requestId": "9fe12a9e-446a-4c8e-90db-d0004ac42e31", [10/16/2017 6:54:51 PM] "method": "GET", [10/16/2017 6:54:51 PM] "uri": "/admin/functions/noderepo" [10/16/2017 6:54:51 PM] } [10/16/2017 6:54:51 PM] Executed HTTP request: { [10/16/2017 6:54:51 PM] "requestId": "9fe12a9e-446a-4c8e-90db-d0004ac42e31", [10/16/2017 6:54:51 PM] "method": "GET", [10/16/2017 6:54:51 PM] "uri": "/admin/functions/noderepo", [10/16/2017 6:54:51 PM] "authorizationLevel": "Anonymous" [10/16/2017 6:54:51 PM] } [10/16/2017 6:54:51 PM] Response details: { [10/16/2017 6:54:51 PM] "requestId": "9fe12a9e-446a-4c8e-90db-d0004ac42e31", [10/16/2017 6:54:51 PM] "status": "MethodNotAllowed" [10/16/2017 6:54:51 PM] }Visit in browser
http://localhost:7071/admin/functions/noderepo
Upon vising my timer trigger, I get:
<Error>
<Message>
The requested resource does not support http method 'GET'.
</Message>
</Error>
I tried substituting noderepo with timerTrigger and myTrigger in the URL and still same thing. How do I debug this?
Execute the JavaScript function method and break on the VS Code
Other information
My index.js is this:
module.exports = function (context, myTimer) {
var timeStamp = new Date().toISOString();
config.UseTimers();
if(myTimer.isPastDue)
{
context.log('JavaScript is running late!');
}
context.log('JavaScript timer trigger function ran!', timeStamp);
context.done();
};
Very simple....
