Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

Blazor WASM App + Azure Static Website + CosmosDB binding + Github Actions = 'cosmosDB' with missing or invalid direction

Open PizzaConsole opened this issue 3 years ago • 3 comments

Bug Report

I used the Github action file that Azure auto generates with. I am using "Microsoft.NET.Sdk.Functions" Version="4.1.0" My code:

        [FunctionName("ProductsGet")]
        public static IActionResult GetAllProducts(
    [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "products")] HttpRequest req,
    [CosmosDB(
        databaseName: "productsdb",
        collectionName: "products",
        ConnectionStringSetting = "CosmosDBConnection")]
        IEnumerable<Product> products,
    ILogger log)
        {
            log.LogInformation("Getting products");
            return new OkObjectResult(products);
        }

It run fines locally, but when it gets to the Build and Deploy stage of the Github action it throws this error:

---End of Oryx build logs--- Function Runtime Information. OS: windows, Functions Runtime: ~4, dotnet version: 6.0 Finished building function app with Oryx Error in processing api build artifacts: the file 'ProductsGet/function.json' specifies a binding of type 'cosmosDB' with missing or invalid direction ''. Visit https://github.com/Azure/azure-functions-host/wiki/function.json for more information.

The project is like this one, except I tried to integrate CosmosDB

PizzaConsole avatar Mar 18 '22 07:03 PizzaConsole

I have the same issue with the SignalR binding

uxsoft avatar Apr 09 '22 20:04 uxsoft

I had the Exact SameProblem , Reverting back to Microsoft.NET.Sdk.Function 4.01 (Instead of 4.1.0) solved it for me

Tasmanakos avatar May 04 '22 16:05 Tasmanakos

I had the Exact SameProblem , Reverting back to Microsoft.NET.Sdk.Function 4.01 (Instead of 4.1.0) solved it for me

Thanks! Reverting to 4.0.1 solved the problem for me too.

StacyCash avatar May 27 '22 16:05 StacyCash

This issue seems resolved. Will be closing this issue. If this is still relevant and impacting you please open a new issue and link back to this issue for reference.

simonjj avatar Jan 11 '24 17:01 simonjj