I am not able to use bcrypt in azure function app.

Swarnnika Singh 0 Reputation points
2023-03-14T17:31:36.58+00:00

I am error that it's not a win32 apps.
cannot load function: 'C:\home\site\wwwroot\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node is not a valid Win32 application. I tried argon2 as well as bcrypt.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-03-17T13:39:21.88+00:00

    Swarnnika Singh Thank you for posting your question in Microsoft Q&A. This issue is similar to an issue in GitHub thread: node_modules\bcrypt\lib\binding\bcrypt_lib.node is not a valid Win32 application and suggest you use bcryptjs (works in Azure environment) instead of native bcrypt module.

    Also, make sure to run npm rebuild bcrypt --build-from-source (reference: https://stackoverflow.com/questions/60962219/error-bcrypt-lib-node-is-not-a-valid-win32-application). If you still face any issues, let me know more about the function runtime version, full exception etc.


    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.