Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Azure Functions v4 #592

Open
sathishmohan-ps opened this issue Apr 8, 2022 · 12 comments
Open

Add support for Azure Functions v4 #592

sathishmohan-ps opened this issue Apr 8, 2022 · 12 comments

Comments

@sathishmohan-ps
Copy link

This is a Feature Proposal

Description

Microsoft team launched Azure Functions 4.0 (GA) across Windows and Linux back in November, 2021. Could you please add support for latest version. serverless-azure-functions plugin allows us to deploy azure functions v3.5.2. We couldn't able to move to the latest version.

@marcelvandesteeg
Copy link

What would be required to implement this and add support for .NET 6?

@VictorioBerra
Copy link

I would also like to see this.

@mwesigab
Copy link

Waiting on this one too.

@gligorkot
Copy link
Collaborator

Following - we're wanting to use v4 as well for Node 16 support.

@stefan-h-singer
Copy link

Azure is ending support for Node12 soon, but using serverless-azure-functions we cannot upgrade our project to Node16. Is anyone working on this?

@pgrzesik
Copy link
Collaborator

Hello folks, I’ve recently got access to this project and in the coming weeks I will try to investigate this issue (among a few other open initiatives). If you have any insights about this particular feature, please share it, it will be much appreciated 🙇

@kevin-boutin
Copy link

@stefan-h-singer it's a pretty easy thing to change. There is a pull request for nodejs14 that will get you a start.

@pgrzesik
Copy link
Collaborator

Hello folks 👋 I started digging a bit and it seems like it's possible to use v4 even in the current version. It looks like it's not documented though 😓 You can do so by setting functionApp.extensionVersion on provider like this:

provider:
  name: azure
  functionApp:
    extensionVersion: '~4'

It worked without issues for me, but you might want to first test it out on non-prod environment. In the next major version of the plugin it should be set to ~4 by default.

@kevin-boutin
Copy link

Hello folks 👋 I started digging a bit and it seems like it's possible to use v4 even in the current version. It looks like it's not documented though 😓 You can do so by setting functionApp.extensionVersion on provider like this:

provider:
  name: azure
  functionApp:
    extensionVersion: '~4'

It worked without issues for me, but you might want to first test it out on non-prod environment. In the next major version of the plugin it should be set to ~4 by default.

I can confirm this does work. I've been doing this for months now.

@gligorkot
Copy link
Collaborator

@pgrzesik do you know if there's any maintainers of this project? You were the last one to comment so just checking :)

@meet-fw
Copy link

meet-fw commented Apr 3, 2023

This solution works with runtime: nodejs14,
The current maintainers are not accepting changes so If you want to use runtime: nodejs16 or runtime: nodejs18 then I'll recommend forking the package or implementing patch-package module which I did and make following changes to it:

diff --git a/node_modules/serverless-azure-functions/lib/config/runtime.d.ts b/node_modules/serverless-azure-functions/lib/config/runtime.d.ts
index 0a95c59..a7743a3 100644
--- a/node_modules/serverless-azure-functions/lib/config/runtime.d.ts
+++ b/node_modules/serverless-azure-functions/lib/config/runtime.d.ts
@@ -2,6 +2,7 @@ export declare enum Runtime {
     NODE10 = "nodejs10",
     NODE12 = "nodejs12",
     NODE14 = "nodejs14",
+    NODE16 = "nodejs16",
     PYTHON36 = "python3.6",
     PYTHON37 = "python3.7",
     PYTHON38 = "python3.8",
@@ -35,6 +36,7 @@ export declare const dockerImages: {
     nodejs10: string;
     nodejs12: string;
     nodejs14: string;
+    nodejs16: string;
     "python3.6": string;
     "python3.7": string;
     "python3.8": string;
diff --git a/node_modules/serverless-azure-functions/lib/config/runtime.js b/node_modules/serverless-azure-functions/lib/config/runtime.js
index 6b8c5a0..fc86cfd 100644
--- a/node_modules/serverless-azure-functions/lib/config/runtime.js
+++ b/node_modules/serverless-azure-functions/lib/config/runtime.js
@@ -15,6 +15,7 @@ var Runtime;
     Runtime["NODE10"] = "nodejs10";
     Runtime["NODE12"] = "nodejs12";
     Runtime["NODE14"] = "nodejs14";
+    Runtime["NODE16"] = "nodejs16";
     Runtime["PYTHON36"] = "python3.6";
     Runtime["PYTHON37"] = "python3.7";
     Runtime["PYTHON38"] = "python3.8";
@@ -25,6 +26,7 @@ exports.supportedRuntimes = [
     Runtime.NODE10,
     Runtime.NODE12,
     Runtime.NODE14,
+    Runtime.NODE16,
     Runtime.PYTHON36,
     Runtime.PYTHON37,
     Runtime.PYTHON38,
@@ -121,6 +123,7 @@ exports.dockerImages = {
     nodejs10: "NODE|10",
     nodejs12: "NODE|12",
     nodejs14: "NODE|14",
+    nodejs16: "NODE|16",
     "python3.6": "PYTHON|3.6",
     "python3.7": "PYTHON|3.7",
     "python3.8": "PYTHON|3.8",

@gligorkot
Copy link
Collaborator

@meet-fw if you use the master branch, it actually has node 16 and node 18 support merged in already, just no new release tagged just yet.

You can use this in package.json for your dependency (obviously need to be careful if the master branch moves, but you can always fork it at the current spot and use it from your forked repo):

"serverless-plugin-optimize": "github:serverless/serverless-azure-functions.git#master",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants