Hi @javier
You cannot use the HTTP request body and passed the value to the input binding for the blob. The alternative way would be passing a parameter to HTTP request and then use that parameter in the path of your blob input bindings.
Please note that if the blob name is passed incorrectly (blob doesn't exist) in the parameter of HTTP request then your function will not execute as you would have defined your function as to take InputStream or other supported value which will fail.
HTTP Request URL : http://{yourfunctionapp}/api/HttpTrigger1?blobname=test.txt
In the above, if test.txt is not in the container input for the configured storage account then your function will fail as mentioned above.
def main(req: func.HttpRequest, inputblob: func.InputStream) -> func.HttpResponse:
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"name": "inputblob",
"type": "blob",
"path": "input/{blobname}",
"connection": "AzureWebJobsStorage",
"direction": "in"
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}
If this works with you then you can go with this approach but the function will always return 500 error if the inputs blob name is not correct.
The alternative you can only use HTTP input binding and based on HTTP body input you need to write your own code to communicate with storage services.
Please let me know if you have any queries or concerns.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.