2

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
WaqarAli
  • 173
  • 10

1 Answers1

1

What is the listening on url ?

If it listen localhost port. In Azure App Services, it just support 80 and 443. If other server URL,it should be works fine.

You also can refer to the comment in this post. I think the usage of HttpListener is correct, it should be useful to you.

Reference post:

Django channels and azure

Strapi on Azure does not run

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • I have debugged my application through Azure app service remote debugging and found that on Calling listener.start() method error is access denied. – WaqarAli Oct 07 '20 at 06:43
  • 1
    @WaqarAli Can you try to use azure cloud services? The same code to deploy, if it can work normally, then it should be the port of the azure web site or other restrictions. – Jason Pan Oct 07 '20 at 06:47
  • Application is already deployed on VM But we are looking for some decent solution where everything is managed by cloud. I have checked Cloud Service at the end it is VM where we need to manage. – WaqarAli Oct 08 '20 at 05:03
  • 1
    @WaqarAli My guess may be that Azure App Service does not support certain ports. The specific reason is suggested to raise a support ticket to confirm. Let the official assistance support to check the log, provide targeted solutions, and see if the azure app service meets your needs. – Jason Pan Oct 08 '20 at 05:15