Azure Cosmos DB input binding for an Azure Function doesn't work
I had the same issue, turns out the new UI generates a different binding than the old one.
New UI:
{
"name": "bookmark",
"direction": "in",
"type": "cosmosDB",
"databaseName": "func-io-learn-db",
"collectionName": "Bookmarks",
"connectionStringSetting": "learn-0088a129-899f-4d18-b4db-5fa74daf1cc3_DOCUMENTDB",
"id": "{id}",
"partitionKey": "{id}",
"sqlQuery": ""
}
Old UI:
{
"type": "cosmosDB",
"name": "bookmark",
"databaseName": "func-io-learn-db",
"collectionName": "Bookmarks",
"connectionStringSetting": "learn-0088a129-899f-4d18-b4db-5fa74daf1cc3_DOCUMENTDB",
"id": "{id}",
"partitionKey": "{id}",
"direction": "in"
}
Removing the
"sqlQuery": ""
part from the binding fixed it for me.
You can switch back to the old UI by clicking the "Having issues? Click to go back to the classic Function App management experience" on the app service overview page, as you can see here.