Azure Function Apps 中缺少 DLL

Missing DLLs in Azure Function Apps

通过执行 post 请求,我在我的 Azure Function Apps 中触发了一个 python 函数。在函数中,我导入了本地开发的myModule,其中包含几个DLL。但是在 Azure Function Apps 中,程序无法导入模块:

D:\home\site\wwwroot\myfunc> python.exe -c "import myModule"
Traceback (most recent call last): 
  File "<string>", line 1, in <module>
ImportError: DLL load failed: The specified procedure could not be found.

使用 depends.exe 我注意到缺少以下 DLL:

我尝试在 windows/system32(Microsoft Windows [版本 10.0.15063])中复制本地计算机中的那些,但当然它没有解决任何问题。 Azure Function Apps 中的 OS 是 Microsoft Windows [Version 6.2.9200].

如何在我的 Azure Function App 中安装这些 DLL?

我搜索了 MFPlat.dll 库,它是 Media Foundation Platform DLL。根据Win32k.sys (User32/GDI32) Restrictions for Azure App Services that include Azure Function App的描述,我认为你不能安装或使用这个可能依赖于GDI库的DLL。所以我建议尝试将您的应用程序部署到 Azure VM 或使用其他没有任何 GDI 依赖项的库。