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

Support for 64bit function development #376

Closed
paulbatum opened this issue Jul 7, 2017 · 22 comments
Closed

Support for 64bit function development #376

paulbatum opened this issue Jul 7, 2017 · 22 comments
Assignees
Labels

Comments

@paulbatum
Copy link
Member

You can configure your function app to run in 64 bit mode when running in Azure, but the local experience in visual studio does not support running locally in 64 bit. If you try to switch your project over to target x64 you'll get the following error:

Could not load file or assembly 'file:///C:\Users\pbatum\Source\Repos\FunctionApp3\bin\x64\Debug\net461\FunctionApp3.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format
@ahmelsayed
Copy link

@jeffhollan jeffhollan added this to the Visual Studio Triage milestone Oct 28, 2017
@simeyla
Copy link

simeyla commented Aug 19, 2018

@paulbatum But this still doesn't give me 64 bit Node right?
I'm primarily using .NET Core but I have one Node service I need (sharp) that requires 64 bit Node to run.

Anybody know if there will be upcoming support for this ?

@paulbatum
Copy link
Member Author

So functions inherits the behavior of App Service and I just investigated and it looks like App Service does not provide x64 node.exe built in.

It might be possible to workaround this by uploading your own x64 version of node and then using the app setting languageWorkers:node:defaultExecutablePath to point at that version. But I haven't tried this.

@Kjue
Copy link

Kjue commented Sep 15, 2018

I can verify that this approach works. I've just done it as I have custom modules that require them to run on 64-bit architecture. You just go to the app settings and enter the local path for the node executable you want to be running. This of course is a way of defining your node environment at the same time too. Thanks for the help @paulbatum!

I downloaded the related NodeJS release zip from the node repository at https://nodejs.org/download/release/ and uploaded the unzipped package as part of my deployment to the function. Then I set the variables like this:

languageWorkers:node:defaultExecutablePath : D:\home\site\wwwroot\node-v8.12.0-win-x64\node.exe

@Frankwayne
Copy link

Thanks @Kjue @paulbatum updating the node js.exe to a 64 solved my out of memory problems.

I'm unsure if thjis is needed but I also updated the application setting "general setting: platform" from 32 bit to 64 bit as well.

@Frankwayne
Copy link

I forgot to mention as well. If you are using the run from zip setting, be sure to place your node.js exe in a different place than wwwRoot. I did mine one level above wwwRoot in a folder called D:\home\site\wwwroot\NodeV8.12.0x64 \node.exe

@Kjue
Copy link

Kjue commented Sep 18, 2018

Yes, it is necessary to upgrade the environment to 64bit to run node in that. I should then also add that I deployed with Visual Studio Code. Just had the node folder as part of the main folder for functions. Cheers!

@Frankwayne
Copy link

if you wish to debug in visual studio with the 64 bit azure functions runtime you can peform the steps I have outlined in this issue

Azure/azure-functions-core-tools#117

Be warned though you are pretty much fooling the Azure functions and web jobs tools extensions into running your version of the Azure functions CLI

@paulbatum
Copy link
Member Author

@Frankwayne Just FYI, I outlined a somewhat less invasive approach in my comment here. This has the added benefit of letting you switch easily between the built in bits and the 64bit build.

@Frankwayne
Copy link

very nice. I will have to share this with my team. I think this will be the preferred method of updating the azure functions core tooling.

@ColbyTresness
Copy link

This issue was moved to Azure/azure-functions-vs-build-sdk#291

@ColbyTresness
Copy link

Reverting move, tracking here.

@ColbyTresness
Copy link

@soninaren what are your thoughts on this one?

@soninaren
Copy link
Member

@ColbyTresness We already provide a 64 bit version of CLI to VS. The pending work here is on the VS team to use that when the user selects x64 from the drop down in VS.
https://github.com/Azure/azure-functions-tooling-feed/blob/master/cli-feed-v3.json#L1708

@ColbyTresness
Copy link

@vijayrkn are you tracking this?

@vijayrkn
Copy link

I will add an item to our backlog to track this.

@AngelosP
Copy link
Member

Visual Studio 2019 16.4 P1 has added support for this :)

@ColbyTresness
Copy link

Closing per above!

@mahesh2000
Copy link

is there a way to run 64-bit node.exe for azure functions on the server? i'm unable to run the sharp module (it's for svg to png image conversion) as it requires this. thanks!

@soninaren
Copy link
Member

cc: @mhoeger

@kevinclarkadstech
Copy link

Ugh I wasted a bunch of time trying to deploy an Azure function to face this same issue.

@mhoeger
Copy link

mhoeger commented Dec 14, 2020

Hi @kevinclarkadstech - sorry about that ! Please see here for the latest guidance: Azure/azure-functions-nodejs-worker#158 (comment) .

You should just be able to switch the app's configuration to "64-bit" and it should work without having to add the app setting Paul described.

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

No branches or pull requests