Azure App Service getting "503 Service Unavailable" after deploying through DevOps pipeline - asp.net-core

I have asp.net core web app that has been running fine in an Azure app service for the past couple of years. I have regularly published new versions of the app using the "Publish" feature in Visual Studio 2019, and have never received the 503 error while the app service is running. I recently set up a multi-stage release pipeline for the app in Azure DevOps. The first stage of the pipeline deploys the build to an Azure app service that we use as a test environment. The second stage has an approval condition set up on it and after the approval is completed, it deploys the build to the app service in our production environment.
This is my first deployment using the pipeline. For the past couple weeks, I've deployed builds through the first stage of the pipeline and tested the app service with no problems. When we approved the build for Stage 2, the pipeline completed successfully (with no errors in the logs) and the build was deployed to our production environment. However, when I try to access the app service I receive a "503 Service Unavailable" error.
I have tried restarting the app service (several times), and compared the configurations between our test and production environments, but did not find any significant differences between the them. I compared the pipeline stages and the only difference I saw was the app services they deployed to.
Unable to resolve the issue, I ended up setting the "WEBSITE_RUN_FROM_PACKAGE" setting to "0" and published the app from Visual Studio, instead of using the pipeline. This was done only as a temporary work-around, so our users would not experience an extended outage while I work to resolve the pipeline issue.
So, now I need to figure out what is causing the 503 error when I deploy through the pipeline. If anyone has some suggestions on how I can fix the issue, or point me in the direction of what to look for, I would greatly appreciate the help.

Related

Can Hangfire schedule jobs do this?

I am evaluating Hangfire for an upcoming ASP.net Core project that has several scheduled and reoccurring tasks that need to execute independently of users clicking on web pages. I know that HangFire can do this if the web application is started because a request has come in. I need to know whether or not HangFire can execute a scheduled task between being rebooted and the first web request coming in.
Example: Web server is rebooted at 11pm, and no web requests will come in to cause the web server to spin up until 5am the next morning. A scheduled task needs to be performed at 1AM. Will Hangfire execute this task even though the web application hasn't been started by an incoming request?
If it can, is there a certain setup I need to do to allow this?
Details, if needed:
We are going to be using Kestrel hosted in a windows service and sitting behind an NGINX reverse proxy. This setup could be modified if needed to make HangFire meet this requirement.
When running under IIS it would be a real problem, see Making ASP.NET application always running
But it should not be problem for ASP.NET CORE with kestrel, see
It is not necessary for ASP.NET Core, because application is exposed
by a console application that it already always on – there are no
timeouts, no suspends and other optimization techniques yet. All you
need to do is to use supervisor as written in the official docs for
Linux, or use Windows Service with automatic start time, when running
on Windows.

Never ending deployment on Azure ACS Kubernetes

Any idea to have a running kubernetes on Azure?
I try the deploy with the Azure UI and after 49 minutes 6 secondes the deployment is still running.
Thanks.
The deployment should take 5 to 10 minutes. There are three reasons why the deployment may take longer:
Service principal is not setup correctly: https://github.com/Azure/acs-engine/blob/master/docs/serviceprincipal.md
There is a platform issue with the VM or extension.
If you are using windows, the image may not be provisioning.
Try the deployment again, and if it falls in reason #2 or #3, please submit an incident through the portal. If you suspect different than #1-3, please submit an issue through https://github.com/azure/acs/issues.

Getting connection_abandoned_by_reqqueue error when hitting a WCF service in one environment

I have a WCF service deployed across three different environments. In one environment it is working fine without any issues but in other two environments it is failing to get response data. All other WCF services are working fine in those enovironments. Suddenly service started working for some time in all environments and again started same issue.
I can see error connection_abandoned_by_reqqueue in http logs for that particular service.
Any help would be appreciated!!

WCF Service Warm Start with IISExpress

I'm building a WCF service that on startup (not first invocation) needs to monitor the filesystem for files to be updated. I have the service working however, I'm running into a problem where I can't get the WCF service to "warm up" on deployment and start doing its job. The only way I've been able to get the service to start is by directly poking it via one of its web methods.
I've followed the instructions in the following articles to no avail:
IIS 8 Application Initialization - warming up WCF services
http://www.codeproject.com/Articles/508713/Custom-WCF-web-service-warm-up
The only difference between what I'm doing and the samples appears to be that I'm using IISExpress. Has anyone had any success with WCF Service warm starts in IISExpress?
Dev Env: Visual Studio 2012 Sp2

Azure Deployment Problem: One instance of an Azure Role starts, the other is "waiting for host" indefinitely - what can cause this?

I have a fairly simple WCF Role on Azure that I am trying to deploy two instances of - the role is fairly-well united tested and I've been able to run it successfully on the local emulator with no readily apparent issues.
The role has a couple of startup tasks that run in the background as the role starts, namely the installation of a pair of Windows Services that run asynchronously in the background doing data processing.
When I deploy the Azure, the first role instance boots normally and quickly, with the Windows Services successfully installed and running (I RDPed in to verify.) The second instance permanently hangs in a "Waiting for Host" state. I've tried rebooting that role instance individually and it doesn't appear to fix the problem.
I've also tried redeploying the entire package to Azure with the same results - first role instance starts fine, the second hangs.
What can cause this problem? Where should I look to try to fix the issue?
So ultimately I resolved this issue by turning to Windows Azure support - turns out I was being consistently deployed onto a "bad node" which I didn't think was possible given how the Fabric Controller works.
Nonetheless, if you run into this issue - Azure support is your best bet.