Simple Azure Function do Demonstrate in Excel
#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) | |
{ | |
log.LogInformation("C# HTTP trigger function processed a request."); | |
string v1 = req.Query["value1"]; | |
string v2 = req.Query["value2"]; | |
if(v1!=null && v2!=null) | |
{ | |
int result = int.Parse(v1) + int.Parse(v2); | |
return (ActionResult)new OkObjectResult($"{result}"); | |
} | |
else | |
{ | |
return new BadRequestObjectResult("Invalid input"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment