How to get client IP address in Azure Functions C#? -
i'm writing function in c# using azure functions , need ip address of client called function, possible?
here answer based on 1 here.
#r "system.web" using system.net; using system.web; public static httpresponsemessage run(httprequestmessage req, tracewriter log) { string clientip = ((httpcontextwrapper)req.properties["ms_httpcontext"]).request.userhostaddress; return req.createresponse(httpstatuscode.ok, $"the client ip {clientip}"); }