it worked for me:
https://stackoverflow.com/questions/61988060/azure-cosmos-db-input-binding-for-an-azure-function-doesnt-work
Azure learning error: Can't bind CosmosDB to type 'System.String'
While doing the https://learn.microsoft.com/en-gb/learn/modules/chain-azure-functions-data-using-bindings/, "Exercise - Read data with input bindings", I'm getting error
> Can't bind CosmosDB to type 'System.String'. Possible causes: 1) Tried binding to 'Microsoft.Azure.Documents.Client.DocumentClient, Microsoft.Azure.DocumentDB.Core, Version=2.9.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' but user type assembly was 'System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.
Everything is set correctly, exactly the same as specified in the tutorial (I've done it x3 to be sure).
Seems like a bug to me.
-
Angel Emanuel Steven Rodriguez Castro 101 Reputation points
2020-06-08T22:33:59.71+00:00
5 additional answers
Sort by: Most helpful
-
VU LE 1 Reputation point
2021-05-17T09:14:51.917+00:00 The value for id, partitionKey should be {id} to make it work
You should update the values in function.json like this:} "name": "bookmark", "direction": "in", "type": "cosmosDB", "databaseName": "func-io-learn-db", "collectionName": "Bookmarks", "connectionStringSetting": "exercise-app-sw1980_DOCUMENTDB", "id": "{id}", "partitionKey": "{id}" }