I have an Azure function written in Python. This function takes DatabaseName, CompanyId, TeamId and AssessmentId as parameters. I need to call this Azure function from ADF. I’m using the Azure function activity in ADF to call this function and passing the parameters using pipeline parameters. I tried multiple ways and everything resulted in the below error –
Call to provided Azure function ‘textgenerationtrigger?DatabaseName=devenv&CompanyId=123&TeamId=456&AssessmentId=789’ failed with status-‘NotFound’ while invoking ‘POST’ on ‘https://fun-cus-textprep-dev.azurewebsites.net’ and message – ‘Invoking Azure function failed with HttpStatusCode – NotFound.’.
I tried testing the function endpoint on Postman and it ran successfully. Query used –
POST request: https://fun-cus-textprep-dev.azurewebsites.net/textgenerationtrigger?DatabaseName=devenv&CompanyId=123&TeamId=456&AssessmentId=789
Steps taken to call my Azure function from ADF:
- Used the Azure function activity
- Linked service pointing to the Azure function app is created and selected as a linked service
- Function name: (tried two ways)
a. textgenerationtrigger (Just the function name)
b. textgenerationtrigger ?DatabaseName=@{toLower(pipeline().parameters.DatabaseName)}&CompanyId=@{pipeline().parameters.CompanyId}&TeamId=@{pipeline().parameters.TeamId}&AssessmentId=@{pipeline().parameters.AssessmentId} (function name with query parameters)
- Method: Post
- Body: (tried two ways)
a. {
"DatabaseName": "@{pipeline().parameters.DatabaseName}",
"CompanyId": "@{pipeline().parameters.CompanyId}",
"TeamId": "@{pipeline().parameters.TeamId}",
"AssessmentId": "@{pipeline().parameters.AssessmentId}"
} (when using just the function name in function name section)
b. {} (When using function name with query parameters)
The expected outcome is Azure function endpoint being executed successfully in the same way on how it is being successful when pinging via Postman.