我们正在为Azure Functions使用Cosmos DB输入触发器,并且无法在我们的其他输入触发器中使用环境变量来进行粘性插槽设置。function.json
有没有其他人在使用Cosmos DB触发器类型时成功使用环境变量function.json
?
函数.json
{
"bindings": [
{
"type": "cosmosDBTrigger",
"name": "inputDocs",
"direction": "in",
"leaseDatabaseName": "leases",
"leaseCollectionName": "MyCosmosCollection-myFunction",
"connectionStringSetting": "CosmosTriggers-SourceAdapter",
"databaseName": "%cosmos-triggers-database-name%",
"collectionName": "MyCosmosCollection",
"createLeaseCollectionIfNotExists": true
}
],
"disabled": false
}
Azure 函数错误
函数 ($myFunction) 错误:函数“Functions.myFunction”的侦听器无法启动。 Microsoft.Azure.WebJobs.Extensions.DocumentDB:源集合“MyCosmosCollection”(在数据库“%cosmos-triggers-database-name%”中)或租约集合“MyCosmosCollection-myFunction”(在数据库“租约”中)不存在。在侦听器启动之前,这两个集合都必须存在。要自动创建租约集合,请将“CreateLeaseCollectionIfNotExists”设置为“true”。Microsoft.Azure.Documents.Client:消息:{“错误”:[“找不到资源”]} ActivityId:b00f7802-fccb-47eb-972d-0bd70ec896c1,请求 URI:rntbd://bn6prdddc05-docdb-1.documents.azure.com:14639/apps/6628b461-75d4-4e4a-9897-ada4076dc30c/services/1b0fc27a-de5 -45cf-a1b2-ebfce044d1e2/partitions/34cfee55-54aa-4e31-81f4-08cf1bfdf62f/replicas/131523094168492638s/。 会话 ID:092ccb7ce9104407bf56c26a5cc8b119 时间戳:2017-10-31T19:13:03.914Z