Share via

Azure Function with native dll x64

Erasmo Solazzo 56 Reputation points
2020-09-01T08:50:46.91+00:00

Hi, I am facing a strange issue.

i need to use in an Azure function some native dll (x64 dll).
Locally function works but when deploy function to Azure I obtain a BadImageFormat exception when native dll are called.

I set 64 bit on Azure portal, compiling with x64 and publishing with Configuration Release x64 and target runtime win-x64.

i use Net Core 3.1 and Azure Function 3.0.9

Am i missing something?

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author

JayaC-MSFT 5,606 Reputation points
2020-09-01T11:27:43.543+00:00

@Erasmo Solazzo By default apps are actually set to run on 32-bit . But, you have also confirmed to modify the bitness from portal. ( could you share a screenshot)
It may be worth looking into the bin/ of the build and seeing if you see the right runtimes/ folder being generated with native libraries.
Could you also share the entire call stack of the exception?
Also, Please follow these steps:

  • Go to https://resources.azure.com/
  • Find your function app, and go under config/web under it in the tree
  • check the value of use32BitWorkerProcess, whether it is false.

Please let me know if this helps.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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