Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CosmosDb bindings #7

Closed
magnus-hansson opened this issue May 24, 2020 · 1 comment
Closed

CosmosDb bindings #7

magnus-hansson opened this issue May 24, 2020 · 1 comment

Comments

@magnus-hansson
Copy link

I wonder if it should be possible to create a function with a cosmosDBbinding with Static web apps at the moment?

I get this error message when I try add a cosmosDB binding to a function:

Error in processing api build artifacts: the file 'products-post/function.json' does not specify a valid function with only HTTP triggers and bindings. Please ensure the JSON contains a single httpTrigger input trigger and a single http output binding.

My function.json looks like this:
{ "bindings": [ { "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req", "methods": ["post"], "route": "products" }, { "type": "http", "direction": "out", "name": "res" }, { "type": "cosmosDB", "name": "inputDocumentIn", "databaseName": "mydb", "collectionName": "mycol", "connectionStringSetting": "CosmosDBConnectionString", "direction": "in", "sqlQuery": "SELECT * from c" } ] }

@johnpapa
Copy link
Collaborator

Thanks for opening this issue. You can open this issue in https://github.com/azure/static-web-apps as it likely relates to your SWA experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants