0
votes

I use site editor for Azure Function. I modified initial function code, so it is now:

#r "Newtonsoft.Json"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
{
    string requestBody = await new StreamReader(req.Body).ReadToEndAsync();

    log.LogInformation(requestBody);

    return new OkObjectResult(requestBody);
}

then added an output to Cosmos Db using output parameter $return

when I'm testing my function I get 404 and nothing else

has anybody faced this issue and what can be done?

1

1 Answers

0
votes

The problem was that I have set 2 output bindings to my function. Initially it was bound to HTTP and I have added Cosmos Db. I removed HTTP output binding and now it works like a charm