From my Azure function (which works in Node.js, called by the EventHub message), I would like to make a request to send to an external page. Sort of:
module.exports = function (context, eventHubMessages) {
var http = require("http");
context.log('JavaScript Function triggered by eventHub messages ');
http.request(post_options, function(res){
...
})
context.done();
The code above will probably work, but I doubt it is not antipattern.
Imagine a situation when thousands of functions are launched in a short time - for each execution we need to create an HTTP client and create a connection ...
From short research, I found some solution for C # Azure functions: https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/
which uses the static HttpClient class.
, Node.js Azure Function? , Node.js Azure?