azure - 使用 Azure Web 作业进行 Rest API 调用

标签 azure azure-webjobs azure-web-app-service

我已经使用基于 HttpTrigger 的 Azure 函数实现了 Rest API 调用,现在客户要求使用 Azure Web 作业而不是 Azure Functions 来实现相同的调用(由于成本)。

是否有任何可用选项,请提供一些如何在 Azure Web 作业中实现它的引用

谢谢!提前

最佳答案

不,这不是 WebJobs 的用途。您可能正在考虑构建 ASP.NET Web API 并将其托管在应用服务计划中。

WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app, API app, or mobile app. There is no additional cost to use WebJobs.

取自 Run Background tasks with WebJobs in Azure App Service

此外,WebJobs 支持 HttpTrigger。 WebJobs 支持的触发器:

  • 计时器
  • Azure 存储队列和 blob
  • Azure 服务总线队列和主题
  • Azure Cosmos DB
  • Azure 事件中心
  • 文件系统

来源:What are Microsoft Flow, Logic Apps, Functions, and WebJobs? - Comparison table

编辑:
就您的解决方案而言:在函数或应用程序服务中运行它。如果只是一次 HttpTriggered 调用,并且 API 不活动后的(次要)启动时间不是问题:请使用 Function 实现。

当检索“大量”记录时(什么是大量?),只要您的函数没有任何状态并且您传入所有信息来确定要接收的记录,就不应该有任何问题。消费计划中的Function应用超时时间默认为5分钟。

关于azure - 使用 Azure Web 作业进行 Rest API 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55183195/

相关文章:

json - 使用 Azure Web 作业将数据导入到 Azure SQL

powershell - 使用 PowerShell 创建计划的 Azure WebJob

c# - 不接受 Azure Function(ILogger 或 TraceWriter)的最后一个日志记录参数

node.js - Node ,postgres pg-promise : Leaking active handles ONLY in azure webapp container

azure - 前几个请求返回 500 Unable to Download OpenID Connect Configuration,然后成功

Azure 不允许我交换到新的较小操作系统磁盘

azure - 使用 MicrosoftGraph API 将应用程序角色分配给用户失败

python - Azure ML执行Python模块: Network I/O Disabled?

azure-application-insights - 如何在 .net core Web 作业中禁用 App Insights 远程依赖项跟踪

azure - 监视连续的 Azure Web 作业