Call Azure function from a Worker
I need to call an Azure function (to run an script on NodeJS) from a CF Worker (Remix on Cf Pages). Is it possible? How can I do that?
6 Replies
You mean like make a HTTP request to your azure function?
Ok, I see. ... It's just a
fetch
to an external API, right?
But how to await
for the response if it takes too long? with waitUntil
?
And because waitUntil
doesn't return anything if I want to get the response from and external API I'd have to set up a webhook in Remix to 'listen' to it?If you need to return a value then you use await but duration for bundled doesn’t include the time for a request to complete. If you don’t need to return the value then using waitUntil is recommended because it won’t block
So if I need to return a value and it takes long... it hast to be via a webhook? Is there any other solution?
What do you mean by webhook? You can still use await fetch because the time it takes to fetch doesn’t count as IO time
ok, I got messed up with the webhook. I think I understand what you mean! thx