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}"); } 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo