Closed voleksiy closed 4 years ago
@voleksiy wasn't able to repro. One thing I did notice in your config is that you have direction
: in
, for both of your triggers (default as not specified in HTTP binding, specified in
in CosmosDB binding). Closing for now
This is still very much an issue.
This is a Bug Report
Description
Getting the following error when attempting to deploy Azure Function with CosmoDB binding (which does have the connection string set, see below):
Error: Required property connectionStringSetting is missing for binding:cosmosDB at Function.BindingUtils.getBinding (/Users/ovolkov/Documents/Development/Hybrid cloud/ToDoApp/Deployment/Azure/node_modules/serverless-azure-functions/lib/shared/bindings.js:127:27)
Relevant YAML file snippet:
provider: name: azure resource-group: ToDoAppResourceGroup location: East US runtime: nodejs10 environment: EXEC_ENVIRONMENT: Azure COSMOS_DB_CONNECTION:
plugins:
serverless-scriptable-plugin functions: ToDos: handler: index_azure.todos
events:
http: true name: req methods: -GET, POST, DELETE route: todos authLevel: anonymous
cosmosDB: name: ToDoRecords
direction: in databaseName: ToDoDB collectionName: ToDosCollection connectionStringSetting: COSMOS_DB_CONNECTION
Looking at bindings.ts (lines 94-104), it doesn't appear to check if the binding setting value is actually set in configuration and throws an error if binding setting is marked required and doesn't have a default value.
Similar or dependent issues:
12345
Additional Data
Serverless Framework Version you're using:
Framework Core: 1.72.0 Plugin: 3.6.13 SDK: 2.3.1 Components: 2.30.12
Serverless CLI Version you're using:
Serverless Azure Plugin Version you're using: 2.0.8
Operating System: Mac OS Catalina 10.15.4
Stack Trace:
Serverless: Initializing provider configuration... Serverless: Parsing Azure Functions Bindings.json... Serverless: Building binding for function: ToDos event: httpTrigger Serverless: Building binding for function: ToDos event: cosmosDB
Error --------------------------------------------------
Error: Required property connectionStringSetting is missing for binding:cosmosDB at Function.BindingUtils.getBinding (/Users/ovolkov/Documents/Development/Hybrid cloud/ToDoApp/Deployment/Azure/node_modules/serverless-azure-functions/lib/shared/bindings.js:127:27) at Function. (/Users/ovolkov/Documents/Development/Hybrid cloud/ToDoApp/Deployment/Azure/node_modules/serverless-azure-functions/lib/shared/utils.js:124:67)
at step (/Users/ovolkov/Documents/Development/Hybrid cloud/ToDoApp/Deployment/Azure/node_modules/serverless-azure-functions/lib/shared/utils.js:43:23)
at Object.next (/Users/ovolkov/Documents/Development/Hybrid cloud/ToDoApp/Deployment/Azure/node_modules/serverless-azure-functions/lib/shared/utils.js:24:53)
at fulfilled (/Users/ovolkov/Documents/Development/Hybrid cloud/ToDoApp/Deployment/Azure/node_modules/serverless-azure-functions/lib/shared/utils.js:15:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com
Your Environment Information --------------------------- Operating System: darwin Node Version: 10.16.0 Framework Version: 1.72.0 Plugin Version: 3.6.13 SDK Version: 2.3.1 Components Version: 2.30.12