c# - Azure函数: Blob identifiers must be in the format 'container/blob'

标签 c# azure azure-functions

我已使用 BlobTriggerCSharp 示例创建了一个Azure Function,并配置了存储帐户和路径:enter image description here

我仔细检查配置的存储帐户中是否有一个 mbrtest 容器:

enter image description here

我没有改变任何其他内容。这是 run.csx:

public static void Run(Stream myBlob, string name, TraceWriter log)
{
    log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}

当我按下运行按钮时,出现以下错误:

2017-05-12T13:47:35.567 Exception while executing function: Functions.BlobTriggerCSharp1. Microsoft.Azure.WebJobs.Host: One or more errors occurred. Exception binding parameter 'myBlob'. Microsoft.Azure.WebJobs.Host: Blob identifiers must be in the format 'container/blob'.

有什么提示吗?

最佳答案

尝试通过以下方式测试您的函数:

  1. 将文件添加到 Blob 容器。例如。创建一个名为 test.txt 的文件,其内容为 TestBody(注意长度为 8)。

  2. 现在检查您的函数日志。您应该看到类似的内容

    2017-05-12T14:03:12.147 C# Blob trigger function Processed blob
    Name:test.txt
    Size: 8 Bytes
    
  3. 现在,要使用门户中的运行按钮,请转到“测试”选项卡并在其中输入mbrtest/test.txt。您应该再次在日志中看到相同的消息(重新处理同一文件)。

据我所知,运行按钮不会为您创建新的 blob。

关于c# - Azure函数: Blob identifiers must be in the format 'container/blob' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43939419/

相关文章:

c# - 如何确定分布式架构?

c# - 如何将 ActiveX 与 ASP.NET 结合使用

azure - F# 和 Windows Azure

Azure 应用程序网关在来自 APIGEE 时对请求正文进行 strip 化

azure - 如何在 Azure 数据工厂中创建审核表,该表将保存 Azure 数据工厂中运行的管道的状态

azure - 检查 Azure Functions 运行的环境

c# - 数据库不创建记录

c# - 为什么我多了一个角色?

azure - 在 Service Fabric 中,可靠队列仅适用于相同的服务类型吗?

azure - 如何将 azure 应用程序洞察链接到 aks