ludo
May 19, 2020, 7:55am
1
Hi,
I have to do some stuff with cosmodb from my functions.
How can i set the cosmodb connection ? inside the serverless.yml ?
I can’t find anything about that inside the documentation.
Can you help me ?
ludo
May 19, 2020, 12:06pm
2
I found this page
But when i try Serverless plugin “cosmosDB” not found. Make sure it’s installed and listed in the “plugins” section of your serverless config file.
I have encountered same issue. I want to create cosmos DB with serverless framework. However, it seems not possible. I have found this source
. Did you solve the problem?
blomm
October 27, 2020, 6:50am
4
It still seems not possible.
I’ve installed the serverless-azure-functions and tried to create the yml configuration, but still having issues, I’ve logged a bug here if anyone can help?
opened 03:58PM - 26 Oct 20 UTC
<!--
1. Please check if an issue already exists. This bug may have already been… documented
2. Check out and follow our Guidelines: https://github.com/serverless/serverless-azure-functions/CONTRIBUTING.md
3. Fill out the whole template so we have a good overview on the issue
4. Do not remove any section of the template. If something is not applicable leave it empty but leave it in the Issue
5. Please follow the template, otherwise we'll have to ask you to update it
-->
# This is a Bug Report
## Description
- What went wrong? : when running sls offline or sls deploy, this error pops up
- What did you expect should have happened? publish to azure with a function that allows me to read/write with cosmosDB
- What was the config you used? (pretty much straight from [the docs](https://www.serverless.com/framework/docs/providers/azure/events/cosmosdb/))
```
functions:
sampleQuery:
handler: src/handlers/sample.query
events:
- http: true
methods:
- POST
authLevel: anonymous
- cosmosDB:
direction: out
name: record # name of input parameter in function signature
databaseName: sampleDB
collectionName: sampleCollection
connectionStringSetting: COSMOS_DB_CONNECTION # name of appsetting with the connection string
createIfNotExists: true # A boolean value to indicate whether the collection is created when it doesn't exist.
```
- What stacktrace or error message from your provider did you see?
Error: Binding direction not supported
at Function. (/Users/michaelblom/development/nanook/reporting-config-api/node_modules/serverless-azure-functions/lib/shared/utils.js:99:39)
Similar or dependent issues:

- I thought it a bit strange that the error message has 2 spaces between Binding and direction, so i've play around with the indentation a bit, but that didn't fix anything.
## Additional Data
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 10.16.0
Framework Version: 2.8.0
Plugin Version: 4.1.1
SDK Version: 2.3.2
Components Version: 3.2.7
- **_Provider Error messages_**:
Error: Binding direction not supported
at Function.<anonymous> (/Users/michaelblom/development/nanook/reporting-config-api/node_modules/serverless-azure-functions/lib/shared/utils.js:99:39)