Azure / Azure/azure-functions-host
Node Language Worker output programming model issues
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
I'm seeing some regressions in programming model from v1 to v2. For example, [this](https://github.com/Azure/azure-functions-host/tree/dev/sample/HttpTrigger-CustomRoute-Post) sample function (and [corresponding test](https://github.com/Azure/azure-functions-host/blob/1dae16ef2061de61ff0cd53b4140ba6443950a99/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/SamplesEndToEndTests.cs#L291)) are currently broken.
Debugging, it appears that the issue is in how the two outputs are returned. The code returns the http response as return value, and sets the blob output binding via `context.bindings.product`. On the .NET side, the response from the worker only has the http return value, not the blob value.
```javascript
module.exports = function (context, req) {
context.bindings.product = req.body;
var res = {
status: 201,
body: 'Product created'
};
context.done(null, res);
}
```
I found this in trying to reenable some of the currently disabled Node e2e tests. When this is fixed, we should be able to reenable the test referenced above.
Contributor guide
Assessment
This issue has not been assessed yet.