Hi Aniesha Razdan,
Thanks for reaching out to Microsoft Q&A.
To extract the status of an Azure Function activity in Azure Data Factory (ADF), you can use the @activity
expression in a dynamic way, but the property you're referencing (executionDetails[0].status
) might not exist in the output schema for the Azure Function activity. Instead, to capture the status, you can rely on the standard output properties for activities.
Here’s how you can try:
- Check the Activity Output: First, verify the actual structure of the output for your Azure Function activity by running the pipeline and checking the activity's output in the ADF monitor.
- Common Output Structure: The Azure Function activity typically has an output structure like this:
{ "StatusCode": 200, "Status": "Succeeded", "Output": { "SomeProperty": "Value" } }
- Extract Status: Assuming the status is directly available in the
Status
field, you can extract it using the following dynamic expression:@activity('AzureFunctionActivityName').output.Status
- Extract Status Code: If you need to capture the HTTP status code, you can use:
@activity('AzureFunctionActivityName').output.StatusCode
If the status or other details are embedded in a deeper nested object, adjust the expression accordingly based on the actual output schema that you see in the pipeline run history. If your azure function returns a custom response body, ensure your function is sending a response with clear status information that ADF can easily parse.
Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.