I am new to Azure. I was wondering if I could get some help with updating an existing record via https trigger.
Many solutions I find online are either creating a new record or updating complete document. I just want to update 2 properties in the document.
I tried [this][1] and the following code but it didn't work
[FunctionName("Function1")]
public static HttpResponseMessage Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req,
[DocumentDB("MyDb", "MyCollection", ConnectionStringSetting = "MyCosmosConnectionString")] out dynamic document,
TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
dynamic data = req.Content.ReadAsAsync<object>().GetAwaiter().GetResult();
document = data;
return req.CreateResponse(HttpStatusCode.OK);
}
I want to pass primary key and 2 other values which the document can update based on the primary string. Can anyone help?