503 Service Unavailable on Azure Cloud App - azure

I have the strange problem, that began near one week ago. I have the site, hosted as a cloud app (a webrole with at least 2 instances running, auto scaling up to 4 max) in Azure. And from time to time when I open it I get 503 Service Unavailable error. But if I will refresh the page, site will open without any errors. QA site at the same time works without any problems. May you know why it's going on? Thanks!

503s in Azure App Services are one of these three:
You've reached the quota for the underlying app service plan (obviously doesn't apply to a premium plan)
You're using deployment slots and hitting a slot that is missing code (if the slots are 50%/50% or something like that it would explain why the 503 is intermittent)
Remote Debugger is preventing port binding of the application. Try disabling Remote Debugging and restarting the app service.

Related

Unhealty backend after scaling up App service plan

I have an application gateway running with a web application in a App service plan. The application gateway listens and passes requests to the backend, which is the web app. There is a health probe implemented that works fine.
The web app was reachable fine until I scaled up the Service plan. Suddenly the health probe timed out reaching the backend and I got a 502 bad gateway error in the browser trying to reach the web application. After hours the website suddenly was back and the backend was healthy again. I was under the impression that you could scale up and down the App plan without any noticeable effect on the website, but it seems the gateway was not playing along.
Did I configure something wrong or should this work like I assumed?
I tried to reproduce the same in environment create app service running with application gateway and got a 502 error.
The number of TCP connections allowed by the plan standard while is an older it contains the double make sure while scaling up and down in app service try to remain in same tier so that inbound IP will wait for sometimes and then scale back.
Try to update your default setting in configuration ->General setting-> ARR Affinity Off. Either your application isn't stateful, or the session state is kept on a distant service like a cache or database. And try to Run your application with a minimum of 2-3 instances to prevent from failure.
You can make use of app service diagnostics gives you the right information to more easily
For Reference:
Get started with autoscale in Azure - Azure Monitor| Microsoft
Guide to Running Healthy Apps - Azure App Service
And I got the same error in application gateway as well to avoid the issue
In your virtual network -> service endpoint -> Add endpoint Microsoft.web in default subnet
.

503 The service is unavailable Azure Hosting (S1 Service Plan)

Today I started receiving a 503 error "The service is unavailable." from a web app. The other web apps on the same (S1) service plan seem to be working fine, so I don't think this is a quota issue. The issue started after a simple stop / start of the app service this morning. I've tried searching for solutions but haven't found anything helpful. Can anyone shed some insight on why I may be receiving this error?
Turns out the problem comes from maxed out SNAT ports from a separate application within the same service plan.

WebApi service down hosted on Azure App Service

I hosted a Web Api to azure app service. Everything works fine when I published it.
After a couple of days, the Web Api stops responding. But my app service is still running.
Even added application Insight Logs to all the code, to all the catch blocks, even then its not helpful.No exception was logged to date.
Checked the following, but doesn't seem to be helpful.
Thread Count of app service.
CPU time.
and this was the error when I tried to hit from postman after my web API is down.
<html><head><title>500 - The request timed out.</title></head><body> <font color ="#aa0000"><h2>500 - The request timed out.</h2></font> The web server failed to respond within the specified time.</body></html>
When I restarted my app service the web API started working and stops again after a couple of days.
I think your app service is being idled out due to inactivity . Please set always on to be true in the general settings in configuration blade , you can check out link
App service configuration.

How to fix issue with Azure Web App Services return Error 503

We have deployed in Azure Portal some app services under a free plan. The apps seem to be healthy and were working without problems until today. Suddenly all of them are returning an Error 503 "The service is unavailable.".
Under one of the services in Diagnose and fix problems in azure portal I checked CPU, Memory, Port usage and everything looks healthy.
Any ideas on how to fix the issue?
Could that be Microsoft maintenance and after some hours the sites are working normally again?
After 5 hours the services were up again. Probably it was a maintenance issue. So after no indication that my services have a problem, waiting some hours was the solution. Maybe this site that displays the azure status could be helpful for those that run into this problem.

Azure web app is 503 Service Unavailable. How do I get it back running?

Our website has been hosted on Azure for a few years. Tonight it is throwing 503 Service unavailable errors. I cannot even load a url to a .jpg file. I have restarted the app and still nothing loads from the website. I cannot buy Azure support because I have bought and cancelled Azure support in the past. We are a 3 person business and depend on our small website and it is down and I don't know what to do. None of the trace logs make any sense to me.
I think 503 could mean that you reached a quota and Azure now respond with a 503 for requests. So I would check the Quotas section within your App Service Plan.
Also check:
Troubleshoot HTTP errors of "502 bad gateway" and "503 service unavailable" in Azure App Service
There are several things you can do to help remedy the situation.
Restart the application (please indicate what it is that will help
us)
Restart the instance that the application is running on.
Restore from a previous working backup of the site.
You should also add more information to your post so we can help, like what application you are using e.g. Apache, Nginx ect.
I've also had a similar problem. I had two deployment slots and in the first slot (production) which I had the latest code and in the second slot, I've missed deploying the latest code and configured traffic as 60-40 which gave me hard time finding it.
Once I've set 100% to the production slot it started working.
Just thought to share this in case it could be useful if you come across the same stuff in the future.
For me it was "Path mappings" in "Configuration".
As soon as i added a new Azure Storage Mount, the application broke.
Setting my Storage account -> Networking, to "Enabled from all networks" fixed the issue.
For us it was a result of the remote debugger. Disabling remote debugger and restarting the app service fixed the 503 error. I think one dev was remote-debugging while another was deploying the app and that seems to have caused an issue under the hood of the app service that broke port binding (we were seeing a stack track in logs about failing to bind to port).

Resources