When sending a POST request via Postman to run the sequence, I'm only getting a one-lined response (an ID string). This is coming from the HttpStartJS/index.js file, with the line "context.done(null, {status: 202, body: id});" returning the ID. I've tried playing around with it for a while now, but I can't seem to be able to get the expected HTTP 202 response listed above, and therefore I have nowhere to sent the GET request to check the status of the execution. I hope this isn't too vague, but hopefully somebody could provide some feedback.
Thanks in advanace!
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the feedback! We are currently investigating and will update you shortly.
Adding @kashimiz.
@jmill269 What is the URL you are using in your POST request?
http://localhost:7071/orchestrators/js/E1_HelloSequence is the URL
Hi @jmill269 , this is an unfortunate known limitation of the HttpStartJS function. Short answer: Please use HttpStart for now. For the URL you gave, that would be http://localhost:7071/orchestrators/E1_HelloSequence
The long version is that the JSON containing the orchestration instance management URIs is created in the analogous HttpStart (C#) function by a call to the DurableOrchestrationClient.CreateCheckStatusReponse object. HttpStartJS is currently unable to make this call due to the way that bindings work in languages which Functions runs out-of-process, such as JavaScript.
The management URIs follow a predictable format, so a user could construct them themselves if they were really determined, but that's not a great experience.
We're looking at how we can improve the orchestration starter experience in out-of-proc languages, but for now, an in-proc (C#/F#) starter function is necessary to easily retrieve the management URIs.
Thanks for chiming in @kashimiz!
@jmill269 I will close this out for now. If you have additional questions please just let us know and we can reopen and continue.
Got it, thank you for the response! I'm sure i'm just missing something silly, but..when leaving out the /js path in the URL, I'm now getting a 404 Not Found response. Am I just not able to run the JS examples locally like this, or is there something else?
Again, thanks for the help!
That's probably a bug we discovered and fixed in the latest update to azure-functions-core-tools@core. Can you try running npm install -g azure-functions-core-tools@core to update to the latest release and give it another go?
I just gave that a try, but I'm still getting the 404 response. Just to be sure I also sent the POST request with the /js path, and that worked fine as before. Not too sure what the issue could be
I have noticed that after running 'func host start', it is finding the HttpStartJS function but not HttpStart despite it also being in the same directory
Thanks for that @jmill269
@kashimiz any other thoughts of things can try?
@jmill269 That's odd. 🤔 Just to confirm, are the samples you're running in /samples/javascript from azure-functions-durable-extension's master branch?
Would you also be able to provide the output of the Functions runtime you see when you run func host start? My guess is that there's some trouble indexing the HttpStart function which is why it's showing up as a 404 when you try to call it.
Sorry for the delay, but I would assume so, as I just cloned the repository as outlined in some of the steps in these docs.
Here's the output after running func host start:
Jons-MBP% func host start
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Hosting environment: Production
Content root path: /Users/jonathamiller/Desktop/dev/digIQ/azure/azure-pattern-2/samples/azure-functions-durable-extension/samples/javascript
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
[7/8/18 7:00:05 PM] Reading host configuration file '/Users/jonathamiller/Desktop/dev/digIQ/azure/azure-pattern-2/samples/azure-functions-durable-extension/samples/javascript/host.json'
[7/8/18 7:00:05 PM] Host configuration file read:
[7/8/18 7:00:05 PM] {
[7/8/18 7:00:05 PM] "http": {
[7/8/18 7:00:05 PM] "routePrefix": ""
[7/8/18 7:00:05 PM] },
[7/8/18 7:00:05 PM] "applicationInsights": {
[7/8/18 7:00:05 PM] "sampling": {
[7/8/18 7:00:05 PM] "isEnabled": false
[7/8/18 7:00:05 PM] }
[7/8/18 7:00:05 PM] }
[7/8/18 7:00:05 PM] }
[7/8/18 7:00:05 PM] Starting Host (HostId=jonsmbp-972501797, InstanceId=213af806-c9b8-4777-b55a-13b9e902beef, Version=2.0.11888.0, ProcessId=44590, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=~1)
[7/8/18 7:00:06 PM] 'FUNCTIONS_WORKER_RUNTIME' is specified, only 'node' will be enabled
[7/8/18 7:00:06 PM] Reading Worker config for the language: node
[7/8/18 7:00:06 PM] Loading custom extension 'DurableTaskExtension'
[7/8/18 7:00:06 PM] Loaded custom extension: DurableTaskExtension from '/Users/jonathamiller/Desktop/dev/digIQ/azure/azure-pattern-2/samples/azure-functions-durable-extension/samples/javascript/bin/Microsoft.Azure.WebJobs.Extensions.DurableTask.dll'
[7/8/18 7:00:06 PM] Start Process: node "/Users/jonathamiller/.nvm/versions/node/v10.5.0/lib/node_modules/azure-functions-core-tools/bin/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 63997 --workerId a8690e0d-ac42-49dd-87cd-74c9571b81fd --requestId ff3c9a83-16a3-4861-8123-1ff099d7cd05 --grpcMaxMessageLength 134217728
[7/8/18 7:00:06 PM] Generating 6 job function(s)
[7/8/18 7:00:06 PM] Found the following functions:
[7/8/18 7:00:06 PM] Host.Functions.E1_HelloSequence
[7/8/18 7:00:06 PM] Host.Functions.E1_SayHello
[7/8/18 7:00:06 PM] Host.Functions.E2_BackupSiteContent
[7/8/18 7:00:06 PM] Host.Functions.E2_CopyFileToBlob
[7/8/18 7:00:06 PM] Host.Functions.E2_GetFileList
[7/8/18 7:00:06 PM] Host.Functions.HttpStartJS
[7/8/18 7:00:06 PM]
[7/8/18 7:00:06 PM] Host initialized (1398ms)
[7/8/18 7:00:06 PM] Worker a8690e0d-ac42-49dd-87cd-74c9571b81fd connecting on 127.0.0.1:63997
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...
Http Functions:
HttpStartJS: http://localhost:7071/orchestrators/js/{functionName}
[7/8/18 7:00:07 PM] Host lock lease acquired by instance ID '00000000000000000000000060A760E5'.
[7/8/18 7:00:09 PM] Host started (4262ms)
[7/8/18 7:00:09 PM] Job host started
Thanks @jmill269
@kashimiz any additional thoughts on this?
Update:
I tried a fresh clone in a new directory just to see if I was messing anything up on my end. After running 'func host start' the first time, I noticed a message saying I needed to specify the worker runtime, either node or dotnet for JS/C# respectively. I found that when specifying node, the HttpStart function isn't found and when specifying dotnet, only the HttpStart function is found and nothing else.
Finally, I tried just not specifying a worker runtime at all to see what would happen, and despite the message telling me to do so, all the functions were found and I was able to use HttpStart long at last.
However, I don't get the exact response from the POST request listed in these docs. Instead, I get a response with "id", "statusQueryGetUri", "sendEventPostUri", and "terminatePostUri" fields. After sending a GET request to the statusQueryGetUri link, I do get the expected response though.
I'm not sure if this is a case-specific thing or if there's a problem with specifying the worker runtime in general but, it seems to have done the trick for now. Thanks again for the help with this, I know it dragged out a bit but I really appreciate it!
Thanks for the update @jmill269!
I will close this since the issue is resolved. If you see it pop up again or if someone else notices the same issue we can reopen and continue to dig into it :)
Just a quick follow-up question here. Is there a RESTful API available to use the HttpStart functionality with a custom library or in JS?
@jmill269 I'm not sure I understand the question. Can you elaborate?
Most helpful comment
Update:
I tried a fresh clone in a new directory just to see if I was messing anything up on my end. After running 'func host start' the first time, I noticed a message saying I needed to specify the worker runtime, either node or dotnet for JS/C# respectively. I found that when specifying node, the HttpStart function isn't found and when specifying dotnet, only the HttpStart function is found and nothing else.
Finally, I tried just not specifying a worker runtime at all to see what would happen, and despite the message telling me to do so, all the functions were found and I was able to use HttpStart long at last.
However, I don't get the exact response from the POST request listed in these docs. Instead, I get a response with "id", "statusQueryGetUri", "sendEventPostUri", and "terminatePostUri" fields. After sending a GET request to the statusQueryGetUri link, I do get the expected response though.
I'm not sure if this is a case-specific thing or if there's a problem with specifying the worker runtime in general but, it seems to have done the trick for now. Thanks again for the help with this, I know it dragged out a bit but I really appreciate it!