I am developing an aspnet webapp which is currently deployed on latest IIS and working fine. Now My client asked me to move same application over azure App Service.
I deploy it there and Http Listener which is included in application has stopped working. Same code is working on server machine.
HttpListener listener = new HttpListener();
listener.Prefixes.Add('https//customerurlnameazurewebsites.net/');
listener.Start();
Error is on listener.Start() I am recieving bad gateway error on postman
502 - Web server received an invalid response while acting as a gateway or proxy server.
After Azure Remote Debugging I have found Exception 'Access denied' on
listener.Start();
Same Exception was concurring on local machine and server machine I had solve that problem by following command.
netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user