How to extract a Function App activity output through a Rest Api Call from a different azure data factory.

Shivoy Thakral 20 Reputation points
2023-09-24T22:29:48.3+00:00

Hi All, I am dealing with a complex problem statement. I am developing an ETL process which uses two data factories. I am triggering a particular pipeline from one data factory using a rest api call. Then through another rest api call - I am retrieving the run status of the triggered pipeline. All subsequent activities in this data factory can go on once the run status of the pipeline is "Success" or "Failed". Now - I have a function app activity in the pipeline that I have triggered via the rest api call. I want to retrieve the output of that activity so that I can use it in the subsequent activities in the ADF that originally triggered the pipeline. What can I set as the headers or the body , or what can I use (say azure monitor) to retrieve the output of the Function App activity in the triggered pipeline ?. It would be of great help if someone could help me out with this. Thanks a lot 🧿

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,701 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 13,830 Reputation points
    2023-09-25T02:07:38.4733333+00:00

    To retrieve the output of a Function App activity from another Azure Data Factory using a REST API call, follow these steps:

    1. Trigger the pipeline in the second ADF using its REST API. When you do this, you'll receive a runId in the response.

    Monitor this pipeline by polling its status. Use the runId you got from the previous step to query the pipeline's status using the REST API. Repeat this until the status is either "Success" or "Failed".

    Fetch the output of the Function App activity. With the same runId, query the list of activity runs. Search through the returned activities to find your Function App activity and retrieve its output.

    Addiitonal Note: For authorization, ensure you set the Authorization header with a Bearer token from Azure Active Directory. If triggering from another Azure Data Factory Web activity, you can use Managed Identity for this.

    By following this method, you can easily retrieve the desired output without the need for additional tools like Azure Monitor.


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.