What went wrong?
The following binding config in the serverless.yml results in "Binding not supported" error message during packaging.
cosmosDB:
x-azure-settings:
collectionName: SomeCollection
connectionStringSetting: ConnectionString
databaseName: SomeDatabase
direction: in
id: "{id}"
name: id
partitionKey: "{id}"
There are 3 types of cosmosDB bindings:
cosmosDB with direction in which should yield "$cosmosDBIn_displayName"
cosmosDB with direction out which should yield "$cosmosDBOut_displayName"
cosmosDBTrigger with direction in (direction is obvious here) which should yield "$cosmosDBTriggerIn_displayName"
The above mentioned PR broke the cosmosDBIn binding config by replacing it with the comsosDBTriggerIn.
IMPORTANT: Please note that the current beta version 1.0.2-19 has a feature to download the latest bindings.json from here which will result in breaking any changes we make to the current bindings.json.
Also interestingly in the referenced bindings.json the cosmosDBIn_displayName and cosmosDBOout_displayName bindings are not present at all.
Their corresponding "new names" with the same configuration options are:
documentDBOut_displayName
documentDBOut_displayName
However I think that bindings.json is referencing some legacy stuff.
I have only started diving into this project a few days ago so sorry if I don't understand some hidden knowledge :) please let me know if I'm wrong somewhere.
I'll do PR to fix the cosmosDBIn issue.
What did you expect should have happened?
It should have been translated to a proper binding in the function.json
What was the config you used?
cosmosDB:
x-azure-settings:
collectionName: SomeCollection
connectionStringSetting: ConnectionString
databaseName: SomeDatabase
direction: in
id: "{id}"
name: id
partitionKey: "{id}"
What stacktrace or error message from your provider did you see?
The error is generated by: node_modules/serverless-azure-functions/lib/shared/utils.js line 91 because the generated bindingDisplayName is not among the ones being parsed from the bindindgs.json file.
Additional Data
Serverless Framework Version you're using: 1.67.0
Serverless CLI Version you're using:
Serverless Azure Plugin Version you're using: 1.0.2-19 (beta from npm, but the problem is present in the 1.0.2 version too)
Operating System: 5.3.0-45-generic #37~18.04.1-Ubuntu SMP Fri Mar 27 15:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
This is a Bug Report
Description
Breaking PR: https://github.com/serverless/serverless-azure-functions/pull/399
serverless.yml
results in "Binding not supported" error message during packaging.in
which should yield"$cosmosDBIn_displayName"
out
which should yield"$cosmosDBOut_displayName"
in
(direction is obvious here) which should yield"$cosmosDBTriggerIn_displayName"
The above mentioned PR broke the
cosmosDBIn
binding config by replacing it with thecomsosDBTriggerIn
.IMPORTANT: Please note that the current beta version 1.0.2-19 has a feature to download the latest
bindings.json
from here which will result in breaking any changes we make to the currentbindings.json
.Also interestingly in the referenced
bindings.json
thecosmosDBIn_displayName
andcosmosDBOout_displayName
bindings are not present at all.Their corresponding "new names" with the same configuration options are:
documentDBOut_displayName
documentDBOut_displayName
However I think that bindings.json is referencing some legacy stuff.
I have only started diving into this project a few days ago so sorry if I don't understand some hidden knowledge :) please let me know if I'm wrong somewhere.
I'll do PR to fix the
cosmosDBIn
issue.function.json
node_modules/serverless-azure-functions/lib/shared/utils.js
line 91 because the generatedbindingDisplayName
is not among the ones being parsed from thebindindgs.json
file.Additional Data