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

"direction" not being set in function.json for CosmoDB as output binding #866

Open
ryann3588 opened this issue Sep 2, 2023 · 1 comment

Comments

@ryann3588
Copy link

I'm managing my function apps through Visual Studio and source control is through Azure Dev Ops. I have the repos configured in the function apps. When the functions deploy to azure, the function.json in azure is missing the "direction" binding property. I'd expect the CosmoDB output binding below to be assigned "direction: out." I'm getting an error in the "Integration" tab of the function: "The following bindings are missing the required direction property and may have been placed incorrectly: messagesOut. Please update the bindings in your functions.json file." Of course I can't do this change manually unless I build the function within the console, which I'm not looking to do.

[FunctionName("MapForStorage")]
public static async Task Run(
[EventHubTrigger("test", Connection = "EventsHubConnection")] EventData[] events,
[CosmosDB(databaseName: "test", containerName: "messages", Connection = "CosmosDbConnection")]
IAsyncCollector messagesOut,
ILogger log)
{ }

From function.json in azure:
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-4.1.1",
"configurationSource": "attributes",
"bindings": [
{
"type": "eventHubTrigger",
"connection": "EventsHubConnection",
"eventHubName": "test",
"name": "events"
},
{
"type": "cosmosDB",
"connection": "CosmosDbConnection",
"databaseName": "test",
"containerName": "messages",
"createIfNotExists": false,
"name": "messagesOut"
}
],

  • CosmosDB extenstion v4.3.1.
  • Functions SDK v4.1.1
@ealsur
Copy link
Member

ealsur commented Sep 12, 2023

This is not the right repository for this. You might want to check https://github.com/Azure/azure-functions-templates

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