I am trying to call an Azure Function from ADF. Azure Function has Route implemented as shown below.
[FunctionName("UpdateStatus_V1")]
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post", Route = "V1/UpdateStatus")] HttpRequest req, ILogger log)
Also the host file has a routePrefix in Azure Function
"http": {
"routePrefix": "DeltaAPI"
}
URI on the Function APP appears as below.
https://functionAPP.azurewebsites.net/DeltaAPI/V1/UpdateStatus?code=secret
When i try to invoke this function from Azure Data Factory using a Function Activity - I keep getting this error
{
"errorCode":"3608",
"message":"Call to provided Azure function '' failed with status-'NotFound' and message - 'Invoking Azure function failed with HttpStatusCode - NotFound.'.",
"failureType":"UserError",
"target":"Azure Function1"
}
I have followed the recommendation as per document https://docs.microsoft.com/en-us/azure/data-factory/control-flow-azure-function-activity#routing-and-queries and the adf pipeline code is given below:
{
"name": "FunctionTest",
"properties": {
"activities": [
{
"name": "Azure Function1",
"type": "AzureFunctionActivity",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"functionName": "V1/UpdateStatus",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"value": "@json( '{\n \"transactionid\": \"5d283e11e62943ceb2e6e0bb5fe4898f\",\n \"status\": \"Completed\",\n \"Description\": \"\"\n }')",
"type": "Expression"
}
},
"linkedServiceName": {
"referenceName": "AzureFunction",
"type": "LinkedServiceReference"
}
}
],
"annotations": []
}
}