简体   繁体   English

GdPicture14 是否可以在使用消耗计划的 Azure 函数中工作?

[英]Can GdPicture14 work within an Azure Function using Consumption Plan?

We are trying to move an onprem windows service, that implements a licensed version of GdPicture14 to the Azure Cloud and into a Function using a consumption plan.我们正在尝试将实现 GdPicture14 许可版本的本地 Windows 服务移动到 Azure 云并使用消费计划移动到函数中。

We have the appropriate license keys embedded into the software, but when we deploy to Azure, the function execution hangs (we assume it's because GdPicture, in trial mode, shows a popup that must be dismissed prior to running).我们在软件中嵌入了适当的许可证密钥,但是当我们部署到 Azure 时,函数执行挂起(我们假设这是因为 GdPicture 在试用模式下显示一个必须在运行前关闭的弹出窗口)。

The function execution will timeout after default 10 mins, then retry another 4 times.函数执行将在默认 10 分钟后超时,然后再重试 4 次。

we also don't receive any failure messages in the Monitor section of our function app.我们在函数应用的 Monitor 部分也没有收到任何失败消息。 This is the most troubling part... can't really see what the error is...这是最麻烦的部分……实在看不出是什么错误……

Can anyone tell me if GdPicture14 is compatible in an Azure Function, and what they did to get it up and running?谁能告诉我 GdPicture14 是否与 Azure 函数兼容,以及他们如何启动和运行它?

I have run GdPicture on Azure Functions and on WebJobs before that, although I hadn't run v14 on the latest version of Functions on a Consumption plan.在此之前,我已经在 Azure Functions 和 WebJobs 上运行了 GdPicture,尽管我没有在消费计划的最新版本的 Functions 上运行 v14。 Since I planned on doing that eventually, I setup a test project and tried it.由于我最终打算这样做,因此我设置了一个测试项目并进行了尝试。 It worked for my simple test code (an HttpTrigger generating a dynamic 1D barcode from a number provided in the URL).它适用于我的简单测试代码(一个 HttpTrigger 从 URL 中提供的数字生成动态一维条形码)。

When creating the project in VS, I ensured that I selected "Azure Functions v3 (.NET Core) in the creation wizard. I added the v14 .Net Core DLL as a reference and added my simple test code (which included a real v14 license -- as you said, no trial key or the popup will kill you).在 VS 中创建项目时,我确保在创建向导中选择了“Azure Functions v3 (.NET Core)。我添加了 v14 .Net Core DLL 作为参考,并添加了我的简单测试代码(其中包括真正的 v14 许可证) - 正如您所说,没有试用密钥或弹出窗口会杀死您)。

Publishing is often where GdPicture and Functions/WebJobs have an issue.发布通常是 GdPicture 和 Functions/WebJobs 出现问题的地方。 Specialically for Functions, create a publishing profile that does NOT use Zip Deploy (uncheck the box labelled "Run from Package").特别是对于 Functions,创建一个不使用 Zip Deploy 的发布配置文件(取消选中标记为“从包运行”的框)。 This is because usually GdPicture requires it's extra DLLs on what functions you use (the DLLs in the "Redist" dir, like filters, gdimgplug, etc).这是因为通常 GdPicture 需要额外的 DLL 来说明您使用的功能(“Redist”目录中的 DLL,如过滤器、gdimgplug 等)。 If you use Zip Deploy, there is no way to add them to the Zip.如果您使用 Zip Deploy,则无法将它们添加到 Zip。 Then "Publish" your Function (it will say "Web Deploy").然后“发布”您的函数(它会显示“Web 部署”)。

After publishing your function, you need to FTP in to add the additional DLLs that your function might need (unless you have some super simple function that doesn't use them).发布您的函数后,您需要通过 FTP 来添加您的函数可能需要的其他 DLL(除非您有一些不使用它们的超级简单函数)。 Forgetting to manually adding the DLLs is often the problem I encounter with GdPicture on Azure.忘记手动添加 DLL 通常是我在 Azure 上使用 GdPicture 时遇到的问题。 After FTPing in, change to the "/site/wwwroot/bin" directory of your function and upload the necessary DLLs. FTP 输入后,切换到函数的“/site/wwwroot/bin”目录并上传必要的 DLL。 If you are unsure which DLLs your function might use, you can safely upload all of the DLLs in the "Redist" directory.如果您不确定您的函数可能使用哪些 DLL,您可以安全地将所有 DLL 上传到“Redist”目录中。 It will ignore what you don't need.它会忽略你不需要的东西。 Note, there are 32-bit and 64-bit versions of each DLL.请注意,每个 DLL 都有 32 位和 64 位版本。 If you know for sure that you are running your function as one or the other (specified under Platform Features > Configuration), then you can safely just upload the one you need.如果您确定您正在以一种或另一种方式运行您的功能(在平台功能 > 配置下指定),那么您可以安全地上传您需要的功能。 You can also upload both versions and it will use what it needs.您也可以上传这两个版本,它会使用它所需要的。 You may be able to add these DLLs in code by manually altering the Visual Studio build config, but I haven't ever tried that.您可以通过手动更改 Visual Studio 构建配置在代码中添加这些 DLL,但我从未尝试过。

After uploading the DLLs, restart your Function and test it.上传 DLL 后,重新启动您的函数并对其进行测试。 On the portal, go to the page for your function and open the "Logs" tab at the bottom to view any output.在门户上,转到您的功能页面并打开底部的“日志”选项卡以查看任何输出。 If you have an HttpTrigger, you can test it using the Test tab on the right side.如果您有 HttpTrigger,则可以使用右侧的“测试”选项卡对其进行测试。 Hopefully this will help.希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 消耗计划中的Azure函数执行会相互干扰 - Azure function executions in consumption plan interfere with eachother 为什么我的 Azure Function 在消耗计划上运行而不是扩展? - Why is my Azure Function running on a Consumption Plan not scaling? 使用 Microsoft Playwright 在 Azure Function Linux 消费计划中创建本地 PDF 文件 - Creating a local PDF file in Azure Function Linux consumption plan with Microsoft Playwright Azure 功能:定时器触发和消费计划问题 - Azure Functions: timer trigger and consumption plan issue C#:使用计划上的Azure功能中不存在键集 - C#: Keyset does not exist in Azure Functions on consumption plan Azure 消费计划功能是否使用多台服务器? - Does Azure Functions on Consumption Plan utilize multiple servers? Azure功能:我无法选择消费计划 - Azure-functions: I cannot choose consumption plan 如何在 Azure Durable Function 中安全地生成 GUID? - How can I safely generate GUIDs within an Azure Durable Function? 检测 azure 函数超时以将消息重新路由到应用程序服务计划 - Detect timeout on azure function to reroute message to app service plan Azure - 无法在现有服务计划上创建新的 Web 应用 - Azure - can't create a new web app on an existing service plan
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM