The following code will create a file in a container on my Azure Storage Account.
public static async Task<IActionResult> Run(HttpRequest req, ILogger log, Stream outputBlob)
{
log.LogInformation("C# HTTP trigger function processed a request.");
using (StreamReader streamReader = new StreamReader(req.Body)) {
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
byte[] bytes = Encoding.ASCII.GetBytes(requestBody);
await outputBlob.WriteAsync(bytes);
return (ActionResult) new OkObjectResult("ok");
}
}
The outputBlob is pointing to the StorageAccount. My question is: How do I add an .json extension to the filename?