I'm calling a REST API endpoint via Azure Data Factory using copy activity. The API returns 404 - not found for valid queries where no data is found. Whether this is the appropriate response or not (I have no control over the API), is there a way to access the API status code (i.e. not Azure error code?) in ADF?
I want the pipeline to return 'success' when a 404 not found is returned, but still fail when other errors occur. I have set up an 'on failure' error handling activity, but I'm getting stuck on how to distinguish between 'valid' errors & 404s due to no data.
The error message string contains the status code (& response), which is what I'm after. Ideally I'd like to compare against these without doing a string comparison, especially seeing as the message appears to be constructed using the exact response fields I'm after.
The 404 only occurs for some query parameters & the response is the same via Postman, so I'm relatively confident it is an intended response from the API.
Based on Azure data factory - getting the HTTP Status of a web activity output I'm not sure if this can be done exactly, but thought I'd (a) check & (b) see if anyone can suggest a better approach.




