Hi, I’m trying to set up the yml file to create an azure function that calls a cosmosDB.
My package json has the needed package:
"devDependencies": {
"serverless-azure-functions": "^2.1.0"
}
My serverless.yml mentions the plugin:
plugins:
- serverless-azure-functions
I’ve pretty much copied the docs configuration
functions:
cosmos:
handler: src/handlers/cosmos.write
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.
but when i run sls offline or sls deploy I get an error saying Error: Binding direction not supported
and if I comment out direction then it will error at the next binding name
Has anyone managed to get serverless functions deploying to azure and talking to a cosmosDB?
I can’t find anything online.
I also logged a bug with the azure function plugin: