title: Debugging a Node.js Azure function
body: <p>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: <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local</a></p>
  
  Investigative information
  
  <p>Please provide the following:</p>
  
  <ul>
  <li>Timestamp:</li>
  <li>Function App name: testcenter123</li>
  <li>Function name(s) (as appropriate): noderepo</li>
  <li>Invocation ID:</li>
  <li>Region:</li>
  </ul>
  
  
  
  Repro steps
  
  <p>I have the application handled via a Git repo so it's on my local machine as well.</p>
  
  <p>Provide the steps required to reproduce the problem:</p>
  
  <ol>
  <li><p>Go to root level of function app and run (via powershell): <code>func host start --debug vscode</code></p>
  
  <pre><code>λ func host start --debug vscode
  
                %%%%%%
               %%%%%%
          @   %%%%%%    @
        @@   %%%%%%      @@
     @@@    %%%%%%%%%%%    @@@
   @@      %%%%%%%%%%        @@
     @@         %%%%       @@
       @@      %%%       @@
         @@    %%      @@
              %%
              %
  </code></pre>
  
  <blockquote>
  <pre><code>[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] }
  </code></pre>
  </blockquote></li>
  <li><p>Visit in browser <code>http://localhost:7071/admin/functions/noderepo</code></p></li>
  </ol>
  
  Expected behavior
  
  <p>Upon vising my timer trigger, I get:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Error&gt;
  &lt;Message&gt;
  The requested resource does not support http method 'GET'.
  &lt;/Message&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>I tried substituting <code>noderepo</code> with <code>timerTrigger</code> and <code>myTrigger</code> in the URL and still same thing. How do I debug this?</p>
  
  Actual behavior
  
  <p>Execute the JavaScript function method and break on the VS Code</p>
  
  <h3>Other information</h3>
  
  <p>My <code>index.js</code> is this:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>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();
  };
  </code></pre>
  
  <p>Very simple....</p>