我设置了两个天蓝色函数:
2021-06-23T07:24:19Z [Information] Executing 'Functions.parseProduct' (Reason='New changes on collection products at .....)
2021-06-23T07:24:19Z [Verbose] Sending invocation id:...
2021-06-23T07:24:19Z [Verbose] Posting invocation id:... on workerId:...
然后什么都没发生。它不运行任何代码,也不会产生任何错误。我们的function.json看起来如下:
{
"scriptFile" : "../product-parser-0.0.0-SNAPSHOT.jar",
"entryPoint" : "ourPackageName.productparser.Function.run",
"bindings" : [ {
"type" : "cosmosDBTrigger",
"direction" : "in",
"name" : "productDocuments",
"maxItemsPerInvocation" : 1,
"leaseCollectionName" : "leases",
"databaseName" : "product-management",
"leaseCollectionPrefix" : "parse-product",
"connectionStringSetting" : "OUR_CONNECTION_STRING",
"createLeaseCollectionIfNotExists" : true,
"collectionName" : "products"
}, {
"type" : "cosmosDB",
"direction" : "out",
"name" : "productDocumentOut",
"databaseName" : "product-management",
"connectionStringSetting" : "OUR_CONNECTION_STRING",
"collectionName" : "products"
} ]
}
hosts.json文件如下所示
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
},
"functions": [
"parseProduct"
],
"extensions": {
"cosmosDB": {
"connectionMode": "Gateway",
"protocol": "Https"
}
}
}
该函数运行在消费计划Linux上,并通过ARM模板进行部署。
发布于 2021-06-23 11:38:39
我们搞清楚了。该函数是从ARM模板部署的,在Linux版本中有一个错误。我们有过
"linux_fx_version": "JAVA|11",
但本来应该是
"linuxFxVersion": "JAVA|11",
但是,如果ARM模板验证或函数中出现了一个错误,那就太好了。我们只是偶然发现的。
此错误触发了函数,但没有实际运行。
https://stackoverflow.com/questions/68096782
复制相似问题