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.
5,101 questions
{count} vote

Accepted answer
  1. JayaC-MSFT 5,531 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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.