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
Cyb3r-Jak3
Cyb3r-Jak316mo ago
You mean like make a HTTP request to your azure function?
rodrigo
rodrigoOP16mo ago
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?
Cyb3r-Jak3
Cyb3r-Jak316mo ago
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
rodrigo
rodrigoOP16mo ago
So if I need to return a value and it takes long... it hast to be via a webhook? Is there any other solution?
Cyb3r-Jak3
Cyb3r-Jak316mo ago
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
rodrigo
rodrigoOP16mo ago
ok, I got messed up with the webhook. I think I understand what you mean! thx
Want results from more Discord servers?
Add your server