首页 > 解决方案 > Azure Function (REST API for Http Trigger & using Timer Trigger with Azure Data Factory)

问题描述

I am trying to develop an Azure Function and came across a question regards to the requirement for using HTTP Trigger.

I am trying to pull data using a third party's SDK, and it is XML-based web services (XML API), not REST API, so it appears that I cannot use HTTP Trigger.

1) My understanding is, in order to use HTTP Trigger, I need to have REST API, correct? How about XML API?

I am trying to go with Timer Trigger and use Azure Data Factory to pull data.

2) If I use Timer Trigger and Azure Data Factory (ADF), where does data get stored in between?

Is data stored in the storage account (Table or Blob) that I configured when I created Function App, and then when I execute ADF, data would be pulled from there?

And if so, how does data in the storage account gets truncated (for next run) after it is used?

3) I am trying to locate where the logic of pulling data should go within the Function CS file.

I guess I have to call a method from other cs file (ListVendors.cs) inside the Function app solution to list vendors' data, correct?

And the Main class is in another cs (Program.cs) file.

Do I call/put the class name (& method) inside the Function class inside Run method (as shown below)?

Function class (TimerTrigger_1109_1)

enter image description here

ListVendors class

enter image description here

Main method (Program.cs)

enter image description here

I am trying to understand how Function app gets called vs. how Main method is called within Function application.

4) When I run the solution, how does solution know which file to run (Function file or Main method within the solution)? Since this is Function solution, I am not sure how execution of solution works.

Thanks.

标签: azure-functions

解决方案


感谢JaliyaUdagedara对此线程的回答 - Azure Function (REST API for Http Trigger & using Timer Trigger with Azure Data Factory) - Microsoft Q&A

那么,如果我使用 Timer Trigger 并且有一个逻辑来提取数据列表,我该如何将数据移动到 ADF?

据我所知,ADF 不能直接使用 Timer trigger function.

但您可以先在 Azure 数据工厂中创建 计划触发器:

在此处输入图像描述

然后新建一个 Http Trigger Function,把原来写在里面的逻辑写 Time Trigger Function 进去 Time Trigger Function。然后使用 ADF 中的 Http 触发功能。

关于如何在 ADF 中使用 azure 功能,可以参考这篇 博客

在此处输入图像描述


推荐阅读