Azure storage 0.3 WebJobs SDK破坏了我的参数绑定
我有以下方法定义:Azure storage 0.3 WebJobs SDK破坏了我的参数绑定,azure-storage,azure-webjobs,Azure Storage,Azure Webjobs,我有以下方法定义: public static void ProcessPackageRequestMessage( [QueueTrigger(queues.PACKAGE)] PackageRequestMessage message, [Blob(blobs.PACKAGE + "/{RequestId}_{BlobFile}")] ICloudBlob blob, [Table(tables.PACKAGE)] CloudTable table, [Qu
public static void ProcessPackageRequestMessage(
[QueueTrigger(queues.PACKAGE)] PackageRequestMessage message,
[Blob(blobs.PACKAGE + "/{RequestId}_{BlobFile}")] ICloudBlob blob,
[Table(tables.PACKAGE)] CloudTable table,
[Queue(queues.EMAIL)] out PackageEmailMessage packageEmailMessage)
PackageRequestMessage类的定义如下:
public class PackageRequestMessage
{
public Guid RequestId { get; set; }
public Guid FactoryId { get; set; }
public string BlobFile { get; set; }
public string SKU { get; set; }
public string EmailAddress { get; set; }
}
在SDK的版本0.2中,当将PackageRequestMessage的JSON消息发布到队列时,调用此方法,并根据PackageRequestMessage中的参数(RequestId和BlobFile)找到相应的Blob,所有这些都工作正常
现在,在SDK的版本0.3中,我得到以下错误:
System.InvalidOperationException:System.InvalidOperationException:Exception绑定参数“blob”-->System.InvalidOperationException:name参数“RequestId”没有值
在Microsoft.Azure.Jobs.RouteParser.ApplyNamesWorker(字符串模式,IDictionary2名称,布尔allowUnbound)
位于Microsoft.Azure.Jobs.RouteParser.ApplyBindingData(字符串模式,IReadOnlyDictionary
2 bindingData)
位于Microsoft.Azure.Jobs.Host.Blobs.Bindings.BlobbBinding.Bind(BindingContext上下文)
在Microsoft.Azure.Jobs.Host.Runners.TriggerParametersProvider1.Bind()上
---内部异常堆栈跟踪的结束---
在Microsoft.Azure.Jobs.Host.Runners.DelayedException.Throw()上
在Microsoft.Azure.Jobs.Host.Runners.WebsiteSecuteFunction.ExecuteWithSelfWatch(MethodInfo方法,ParameterInfo[]ParameterInfo,IReadOnlyDictionary
2参数,TextWriter控制台输出)
在Microsoft.Azure.Jobs.Host.Runners.WebsiteSecuteFunction.ExecuteWithOutputLogs(FunctionInvokeRequest请求、IReadOnlyDictionary2参数、TextWriter控制台输出、CloudBlobDescriptor参数记录器、IDictionary
2参数LogCollector)
位于Microsoft.Azure.Jobs.Host.Runners.WebsiteSecuteFunction.ExecuteWithLogMessage(FunctionInvokeRequest请求、RuntimeBindingProviderContext上下文、FunctionStartedMessage消息、IDictionary`2参数LogCollector)
位于Microsoft.Azure.Jobs.Host.Runners.WebsiteSecuteFunction.Execute(FunctionInvokeRequest请求,RuntimeBindingProviderContext上下文)
在仪表板中,消息本身在JSON中显示了一个有效的RequestId,因此我不确定为什么会报告它丢失。Pianomankh,我能够重现您描述的问题,并提交了一个bug。似乎这种失败只发生在blob名称模式中,参数绑定不受影响
目前的解决方法是对属性类型使用
string
而不是Guid
刚刚找到了blob问题的解决方案i0.3.0。与版本0.2.0相比,您必须定义Blob到FileAccess.Write以使其工作。它修复了我上面描述的问题,使其能够流式传输到blob谢谢,期待得到正确的Guid解析。