feat(azure-functions): support azure functions v4
πLinked issues
βType of change
- [ ] π Documentation (updates to the documentation, readme, or JSdoc annotations)
- [ ] π Bug fix (a non-breaking change that fixes an issue)
- [ ] π Enhancement (improving an existing functionality like performance)
- [x] β¨ New feature (a non-breaking change that adds functionality)
- [ ] π§Ή Chore (updates to the build process or auxiliary tools and libraries)
- [ ] β οΈ Breaking change (fix or feature that would cause existing functionality to change)
π Description
I upgraded the @azure/functions package to the latest version, and added the configuration to support the new programming model of Azure functions V4: https://learn.microsoft.com/en-us/azure/azure-functions/functions-node-upgrade-v4?tabs=v4&pivots=programming-language-javascript
I implemented it with the date compatibility system, so it can be adopted progressively.
π Checklist
- [x] I have linked an issue or discussion.
- [x] I have updated the documentation accordingly.
I Still have to do some manual checks for this one + docs
Manually verified the workings of the V4 handler by using a local build of this nitro fork and deploying a Solid Start app to Azure Functions.
Will verify the legacy azure-function runtime next.
Manually verified that the legacy V3 handler still works and is still the default. Will do the docs update tomorrow and verify the working of cookies.
verified cookies work on 4.x runtime (with Solid Start app) + updated docs
Azure Static Web Apps can use @azure/functions v4 programing model nowadays, so azure(Azure Static Web Apps) preset also needs update.
Will update the Azure Static Web Apps preset next week too in this PR. I've been running this preset code in production for an enterprise application for a little while now with success π
Hi @supersoniko, I'm currently reseraching on how to build a preset of a v4 function to a static web app with streaming support.
Can I somehow support you with building the preset or help testing it?
I'm also wondering how does this PR correlate to #2477?
From my point of view it may make sense to keep the azure and azure-function templates and add some config parameter for them, which calls app.setup({ enableHttpStream: true }); if set to true.
I'm not sure if creating two new templates azure-functions-streaming and azure-streaming may make things harder to maintain. But that's just a gut feeling, as I'm kind of new to nitro yet.
Hi @supersoniko, I'm currently reseraching on how to build a preset of a v4 function to a static web app with streaming support.
Can I somehow support you with building the preset or help testing it?
I'm also wondering how does this PR correlate to #2477?
From my point of view it may make sense to keep the
azureandazure-functiontemplates and add some config parameter for them, which callsapp.setup({ enableHttpStream: true });if set to true.I'm not sure if creating two new templates
azure-functions-streamingandazure-streamingmay make things harder to maintain. But that's just a gut feeling, as I'm kind of new to nitro yet.
Hey sorry for the late response; I have been working weekends because of deadlines my company has and haven't had time to look back to this PR.
It would be great to get some support on these Azure presets! I agree that a separate separate streaming preset would not make much sense, especially maintenance wise, like you said.
I haven't looked at Nitro in a while, but iirc there's another preset that has some kind of configuration that you can give with it.
If I have some time this weekend π, I will look into the possibility of configuration options this weekend and report back here.
Any updates?