serverless / serverless-azure-functions

Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
MIT License
266 stars 162 forks source link

CosmosDB binding connectionStringSetting value error (value ignored) #474

Closed voleksiy closed 4 years ago

voleksiy commented 4 years ago

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:

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:

Additional Data

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)

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

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

tbarlow12 commented 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

blomm commented 4 years ago

This is still very much an issue.