Skip to content

Support for 64bit function development #291

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

Closed
ColbyTresness opened this issue Mar 14, 2019 · 11 comments
Closed

Support for 64bit function development #291

ColbyTresness opened this issue Mar 14, 2019 · 11 comments

Comments

@ColbyTresness
Copy link

From @paulbatum on July 7, 2017 21:42

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

Copied from original issue: Azure/Azure-Functions#376

@ColbyTresness
Copy link
Author

From @ahmelsayed on July 7, 2017 21:52

ref: Azure/azure-functions-core-tools#117

@ColbyTresness
Copy link
Author

From @simeyla on August 19, 2018 22:34

@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 ?

@ColbyTresness
Copy link
Author

From @paulbatum on August 20, 2018 23:42

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.

@ColbyTresness
Copy link
Author

From @Kjue on September 15, 2018 13:12

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

@ColbyTresness
Copy link
Author

From @Frankwayne on September 18, 2018 16:41

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.

@ColbyTresness
Copy link
Author

From @Frankwayne on September 18, 2018 16:45

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

@ColbyTresness
Copy link
Author

From @Kjue on September 18, 2018 18:13

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!

@ColbyTresness
Copy link
Author

From @Frankwayne on September 18, 2018 20:16

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

@ColbyTresness
Copy link
Author

From @paulbatum on September 18, 2018 22:27

@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.

@ColbyTresness
Copy link
Author

From @Frankwayne on September 19, 2018 1:56

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
Author

Reverting move, tracking on original issue.

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

No branches or pull requests

1 participant