Azure functions Azure blob触发器动态路径不工作
我使用捕获事件从Eventhub检索事件到存储容器。但在捕获事件中,我选择blob文件路径格式作为Azure functions Azure blob触发器动态路径不工作,azure-functions,azure-blob-trigger,Azure Functions,Azure Blob Trigger,我使用捕获事件从Eventhub检索事件到存储容器。但在捕获事件中,我选择blob文件路径格式作为 {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second} 现在如何在blog触发器中给出动态blob路径 我写的如下 @FunctionName("AzureBlogTriggerFn5") public void blobHandler( @BlobTri
{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}
现在如何在blog触发器中给出动态blob路径
我写的如下
@FunctionName("AzureBlogTriggerFn5")
public void blobHandler(
@BlobTrigger(name = "content", path = "uts-blobcontainer-nb-dev/uts-eventhubns/uts-nb-eventhub/{partition}/{yyyy}/{MM}/{dd}/{HH}/{mm}/{ss}/{fileName}", dataType = "binary", connection = "AzureWebJobsStorage") byte[] content,
@BindingName("fileName") String fileName,
final ExecutionContext context
) throws StorageException, IOException, URISyntaxException, InvalidKeyException, InterruptedException {
context.getLogger().info("Java Blob trigger function processed a blob. Name: " + fileName + "\n Size: " + content.length + " Bytes");
我有以下错误
**2019-12-19T15:05:52.576 [Error] Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.DecompressServiceFunctionNB'. System.Private.CoreLib: An item with the same key has already been added. Key: mm.**
请建议我,如何在Azure中的blogtrigger中为分区ID、年、月、日、时、分、秒提供动态路径?我相信错误是因为同时具有“MM”和“MM” 使用时,键可以是任何字符串。在你的情况下,像这样的东西应该起作用
path = "uts-blobcontainer-nb-dev/uts-eventhubns/uts-nb-eventhub/{partitionId}/{year}/{month}/{day}/{hour}/{minute}/{second}/{fileName}"
And bind the ones you require in your function.