Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java BlobInput的Azure函数绑定问题没有任何错误_Java_Azure_Azure Functions - Fatal编程技术网

Java BlobInput的Azure函数绑定问题没有任何错误

Java BlobInput的Azure函数绑定问题没有任何错误,java,azure,azure-functions,Java,Azure,Azure Functions,我在VSCode中用Java创建了一个azure函数,该函数在本地运行良好 @FunctionName("HttpTriggerGetSha256") @StorageAccount("AzureWebJobsStorage") public HttpResponseMessage run ( @HttpTrigger( name = "req", met

我在VSCode中用Java创建了一个azure函数,该函数在本地运行良好

@FunctionName("HttpTriggerGetSha256")
    @StorageAccount("AzureWebJobsStorage")
    public HttpResponseMessage run (
        @HttpTrigger(
            name = "req", 
            methods = {HttpMethod.GET, HttpMethod.POST}, 
            authLevel = AuthorizationLevel.ANONYMOUS) 
        HttpRequestMessage<Optional<String>> request,
        @BlobInput(
            name = "source", 
            dataType = "binary", 
            path = "{Query.directory}/{Query.filename}")  
        byte[] content,
        final ExecutionContext context) {
        context.getLogger().info("Java HTTP trigger processed a request.");
...
}
@FunctionName(“HttpTriggerGetSha256”)
@存储帐户(“AzureWebJobsStorage”)
公共HttpResponseMessage运行(
@HttpTrigger(
name=“req”,
方法={HttpMethod.GET,HttpMethod.POST},
authLevel=AuthorizationLevel.ANONYMOUS)
HttpRequestMessage请求,
@BlobInput(
name=“source”,
dataType=“binary”,
path=“{Query.directory}/{Query.filename}”)
字节[]内容,
最终执行(上下文){
context.getLogger().info(“JavaHTTP触发器处理了一个请求。”);
...
}
输入绑定正常,“内容”填充文件名的内容

当我部署到azure时,该功能失败。“内容”为空,这意味着有2种可能的原因:

  • 路径未正确填充并使用查询创建
  • 无法打开或访问blob 我已经硬编码了“路径”来进行测试,但是我没有看到任何内容被填充
AzureWebJobs存储已正确填充


任何提示或我必须检查的东西?

部署到
Azure portal
后,
AzureWebJobsStorage
的值是此
Azure函数
所在存储的连接字符串

在这里,您可以检查
azurewebjobstorage
的值是否是要指定的存储器的连接字符串


是的,事实上,我刚刚检查并将代码更改为@StorageAccount(“存储\帐户\连接\字符串”),将其添加到应用程序配置中,但我仍然存在相同的问题。