Just the meaning it shows, cause there is not function.json file when you write your java azure function code, and after function compiled it depends the function.json file to get the input details. More details about function.json refer to here: Function code.
After your java function compiled, you could follow this Folder structure to get the function.json file, then you will find the @BlobInput
binding name will be the blob input binding name.
Below is my test code, get blob content with @BlobInput
binding.
public HttpResponseMessage run(
@HttpTrigger(name = "req", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<String>> request,
final ExecutionContext context,
@BlobInput(
name = "file",
dataType = "binary",
path = "test/abc1.txt",connection = "AzureWebJobsStorage")
byte[] content) {
context.getLogger().info("Java HTTP trigger processed a request.");
String str = new String(content);
context.getLogger().info(str);
return request.createResponseBuilder(HttpStatus.OK)
.body("The size is: " + content.length + " bytes")
.build();
}
And here is my function.json file binding, you could see here name is file
.
"bindings" : [ {
"type" : "httpTrigger",
"direction" : "in",
"name" : "req",
"methods" : [ "GET", "POST" ],
"authLevel" : "ANONYMOUS"
}, {
"type" : "blob",
"direction" : "in",
"name" : "file",
"path" : "test/abc1.txt",
"dataType" : "binary",
"connection" : "AzureWebJobsStorage"
}, {
"type" : "http",
"direction" : "out",
"name" : "$return"
} ]
And below is my test result, log the file content, and send a response. If you still have errors, please share your code to let me have a test. Hope this could help you.
