In Azure, I have an Azure Function which uses .NET and is defined as follows
#r "Newtonsoft.Json" using System.Net; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Primitives; using Newtonsoft.Json; using System.Net.Http; public static async Task<IActionResult> Run(HttpRequest req, ILogger log) { using(var client = new HttpClient()) { String accessToken = XXXXXXXXXX; client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", accessToken); var result = await client.GetAsync("https://allstate.myabsorb.com/api/rest/v1/Coupons"); string resultContent = await result.Content.ReadAsStringAsync(); log.LogInformation(resultContent); } return (ActionResult) new OkResult(); }
I originally ran this as a stand-alone function and it runs successfully. The
XXXXX
All I’m trying to pass into the function is a single string. I just have no idea how to do this and can’t find any examples that are simplistic enough for my smooth ape brain to comprehend. I feel like this is should be a fairly simple process, but I just can’t figure it out… What do?
EDIT: to clarify, my main problem here is I don’t know what to put in the code for it to receive the variable from ADF.
Anonymous Asked question May 13, 2021
Recent Comments