【发布时间】:2021-02-09 06:02:28
【问题描述】:
我有如下定义的 Azure 函数注释。 Blob 触发器从存储帐户进程中读取数据,并使用返回值将输出写入 Blob 容器,并在绑定中定义了“filename”.json。
这是按预期工作的;但是,在将数据写入 blob 容器时。输出绑定通过“GET”请求检查是否存在 Blob,并最终在发出“PUT”请求之前进入 404 响应代码。这是在 Application Insights 中捕获的。
有什么方法可以覆盖这种行为吗? Screen shot of Log analytics here
函数绑定
public class ProcessZipFiles2Cosmos {
@FunctionName("ProcessZipFiles2Cosmos")
@StorageAccount("blobStorageAccount")
@BlobOutput(name = "blob_redacted_json", path = "nonpii/{filename}.json")
public static String run(
@BlobTrigger(name = "files", dataType = "binary", path = "transactedreturn/{name}", connection = "blobStorageAccount") byte[] content,
@BindingName("name") String filename,
@CosmosDBOutput(name = "cosmos_transacted", databaseName = "tax-return-data-ops", collectionName = "TransactedReturns",
connectionStringSetting = "AzureCosmosDBConnection") OutputBinding<String> cosmosItem,
final ExecutionContext context) {
// function body
}
}
FUNCTION.JSON
{
"scriptFile":"../transactedreturn-1.0.0-SNAPSHOT.jar",
"entryPoint":"com.hrblock.clzconverter.ProcessZipFiles2Cosmos.run",
"bindings":[
{
"type":"blobTrigger",
"direction":"in",
"name":"files",
"path":"transactedreturn/{name}",
"dataType":"binary",
"connection":"blobStorageAccount"
},
{
"type":"cosmosDB",
"direction":"out",
"name":"cosmos_transacted",
"databaseName":"tax-return-data-ops",
"connectionStringSetting":"AzureCosmosDBConnection",
"collectionName":"TransactedReturns"
},
{
"type":"blob",
"direction":"out",
"name":"$return",
"path":"nonpii/{filename}.json",
"connection":"blobStorageAccount"
}
]
}
【问题讨论】:
标签: azure azure-functions azure-blob-storage azure-log-analytics azure-java-sdk