azure-functions-host: CLI: Running new node.js function fails...

Please provide a succinct description of the issue.

Repro steps

Provide the steps required to reproduce the problem.

I have a video of the behavior here: https://1drv.ms/v/s!Al5K6Hl-Z2ggovkBH9Xy6sM4TpBgCQ

  1. Create a new folder for your function app
  2. Run func init
  3. Run func new and select:
    • List templates by language
    • JavaScript
    • TimerTrigger-NodeJS
    • name the new function timerTriggerJs
  4. fun func run .\timerTriggerJs --cli-dev
  5. When prompted, type “yes” to enable the launching of the web server.
  6. A window flashes briefly with the error message Unable to parse option verb
  7. An exception is reported at the command line:
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:7071
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at WebJobs.Script.Cli.Verbs.RunVerb.<RunAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NCli.ConsoleApp.<RunAsync>d__5`1.MoveNext()

Expected behavior

It’s never worked for me, but I assume it is supposed to launch a server that runs the function.

Actual behavior

Window flashes with Unable to parse option verb message then closes and the exception shown above is returned.

Known workarounds

none.

Related information

I have a video of the behavior here: https://1drv.ms/v/s!Al5K6Hl-Z2ggovkBH9Xy6sM4TpBgCQ

Using Node.js

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Please reopen - it still does not work for me.

Install of npm i -g azure-functions-cli@0.2.11-preview​​​ works, but func shows Azure Functions Cli (0.2.10.0)

func run func1 does not work: Error: unknown argument run, but func function run func1 works (-> maybe wrong documentation?), but causes the same errors as reported above.​​​

npm i -g azure-functions-cli@0.2.11-preview​​​

I got it running by manually starting the server on port 7071: func host -p 7071

and then in a separate window run: func run <functionname>

Seems related to #840

@mikezks Whoops, left off the .md. Edited above.

@mikezks Sorry you’re running into this–we’re fixing.

You can find the previous article here: https://github.com/Azure/azure-content/blob/8c12413da107d96b541f4fcd0524d2da983b43f2/articles/azure-functions/functions-run-local.md. Thanks for the feedback, if the fix takes too long I’ll see about reverting to the old version.