0

How do I use docuementdb binding with azure function http binding:

using System.Net;

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, out object locationDocument, TraceWriter log){
    log.Info("C# HTTP trigger function processed a request.");
    var data = await req.Content.ReadAsStringAsync();

    return req.CreateResponse(HttpStatusCode.OK, $"{data}");
}

Getting this error:

error CS1988: Async methods cannot have ref or out parameters

1 Answer 1

1

This is not specific to Document DB. If your function is async, and you already used the return value for HTTP output binding, you would need to inject IAsyncCollector<T> for all other output bindings.

See the second example in this answer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.