Azure Error 403 this site is stopped - azure

I have a asp.net mvc5 site running off a azure website, its running off a D1 shared infrastructure.
In the last couple of days I've had a few issues when deploying to it. Its at times been unable to deploy. (i've hashed out my site name)
Error 26 Web deployment task failed. (Could not connect to the remote
computer ("#####.scm.azurewebsites.net") using the specified process
("Web Management Service") because the server did not respond. Make
sure that the process ("Web Management Service") is started on the
remote computer. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
And now when I deploy I'm getting
Error 403 - This web app is stopped.
. When I look in the azure portal it says the site is running and I cannot see anything in the ftp logfiles\http\rawlogs\ which would indicate this issue. i.e. I can just see 200 responses from then the site was last responding.
Restarting the site via the portal doesnt seem to make a difference.
How can i diagnose the cause of this problem? and is it possible that it could be related to any changes i have made to my application rather than a server infrastructure issue?

You may be running into Quota issues if your site is in SHARED mode. Please try upgrading to STANDARD mode.
Here is a screen shot:

I was having the same problem. Our site wasn't in shared mode and scaling up/down to another service plan helped for a moment but the problem quickly recurred.
Turned out the staging environment was bad.
To fix the problem, I had to swap, delete the staging slot, and then wait ~30 minutes before I could recreate it (got errors saying the hostname still existed).

I also had the same deployment problem from Azure Devops and the site wasn't in shared mode.
Failed to deploy web package to App Service.
Error Code: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
More Information: Could not connect to the remote computer ("######.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
Error: The remote server returned an error: (403) Forbidden.
Error count: 1.
Error: C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe failed with return code: 4294967295
I wasn't able to get to the Kudu site (######.scm.azurewebsites.net) from my local machine but I was able to from a JumpBox VM in our Azure subscription.
After inspecting the settings at resources.azure.com I noticed that under the "web" settings:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{SiteName}/config/web?api-version=2018-02-01
The "scmIpSecurityRestrictionsUseMain" value was set to "true". I set it back to "false" and was able to deploy and view Kudu locally again.

Related

Error while Deploy Azure App Service : ERROR_COULD_NOT_CONNECT_TO_REMOTESVC

I am getting below error while deploying app service via Azure DevOps. I tried to search for this issue but could not found root cause of this.
Error :
2021-03-15T06:01:27.7479723Z ##[error]Error: Error Code: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
More Information: Could not connect to the remote computer ("web-app.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
Error: The remote server returned an error: (403) Forbidden.
Error count: 1.
'''
I tried everything until I spotted (after reading this) that my (dev) shared App Service service plan was out of storage space! When I upgraded it to a bigger one I could deploy again!
According to this document, the error is caused by that Web Deploy cannot connect to the remote service. Please refer to the follow points to troubleshoot your problem:
Please make sure Azure app service works fine. You can ping the remote machine.
That the msdepsvc(“Microsoft Web Deployment Agent Service”) or wmsvc(“Web Management Service”) service is started on the remote server.
Your firewall is not blocking incoming connections of your ports on the destination. If you used the default installation, then it would be 80 for msdepsvc and 8172 for wmsvc.
In addition, you could try to add -retryInterval:6000 -retryAttempts:10 to Additional Arguments in Azure App Service Deploy task as this thread stated.
BTW, if this issue still exists in Azure pipeline, please check if this issue exists locally. You could refer to this thread: Got 403 Error when doing Web Deployment and Web Deploy results in ERROR_COULD_NOT_CONNECT_TO_REMOTESVC for more guidance.
Thank you Edward for insightful explanation for possible root cause. Issue is resolved now.
Root cause was the agent pool selected did not have rights for deployment(IP are not whitelisted for production App service) since
We are not using agent provided by DevOps directly for production environment.
An instance that'd worked great for years starting giving me this error yesterday during Web Deploy. No changes from our side. No amount of poking around non-invasively solved it, but simply hitting the Restart button on the Azure app service Overview page put it to bed quite easily.
In short: Double-check your publish profile (each element).
Bit longer: In my case, my publish profile contained a ResourceGroup element which pointed to the wrong resource group. (I'm using WebPublishMethod: MSDeploy) I went over all elements and made sure they point to the correct resource, credentials and whatnot.
That seemed to solve the issue.
In my case, I had modified machine.config to captur traffic in Fiddler
<system.net>
<defaultProxy
enabled = "true"
useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
and this was interfering with the VS deployment to Azure

How to diagnose AspNetCore application not starting on Azure App Service?

We have multiple AspNetCore applications hosted on an Azure Web App as OutOfProcess and deployed as virtual applications with separate paths.
We have the same setup in different environments, all infrastructure and applications are deployed automatically through our pipeline but it's only breaking in one environment and we can't find out why.
We have tried turning on stdoutLogEnabled to true. This reveals an invalid runtime.config.json error, I have read this can be caused by multiple issues but we can't identify any reason for it. We also intermittently see a 502.5 ANCM startup failure when navigating to the swagger URL for each application.
If we look in the application event logs in the Azure portal we are seeing this error failed to start process with command line 'dotnet .\<DLL>' with multiple retries. Failed to bind to port <PortNumber>
We can start the applications locally with Kudu by navigating to the location of the DLL and running dotnet <DLL>. The application starts successfully so it seems to be a problem on the web app. We've tried restarting and stopping and starting the web app, even tried scaling the app service to attempt getting a clean start but nothing has succeeded.
I'm not sure what other steps we can take to diagnose this issue or what we might have done wrong as the same applications are working fine in other environments.

Azure WebDeploy Failing

I've been happily deploying my website to Windows Azure, but this morning I get the following error...
Web deployment task failed. (Could not connect to the remote computer ("xxxxx.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
I can load the website and data is coming back from the WebAPI I have. I've looked at the link which suggests the following....
You can ping the remote machine
That the msdepsvc or wmsvc service
is started on the remote server.
Your firewall is not blocking
incoming connections of your ports on the destination. If you used
the default installation, then it would be 80 for msdepsvc and 8172
for wmsvc.
I've tried the ping, which doesn't work, but then a ping to the actual site doesn't work either (and the site works). As these are Azure servers I'm unsure how to check points 2 & 3.
Another site that I deploy to Azure has worked, so there must be something about this project
I'm hoping someone can point me in the right direction to look.
In the end I fixed the issue, by upgrading from "Shared" to "Basic", and then switched back again, this must of caused some sort or reset at the MS backend.

Web deployment task failed (vs2013)

I successfully deployed 'my project 22' from visual studios 2013 express to microsoft Azure.
It was working fine for about 30 mins.... but now it is giving me an error when loading the projects url http://myproject22.azurewebsites.net/ in browser.
Error 403 - This web app is stopped.
The web app you have attempted to reach is currently stopped and does not accept any requests. Please try to reload the page or visit it again soon.
If you are the Administrator of this web app, please visit the Azure Portal to check why the app is stopped.
When i try to publish the solution i get this error
Web deployment task failed. (Could not connect to the remote computer ("myproject.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
I have tried downloading published profile in azure, putting the file in vs folder publish profiles.
And publishing the project again.
I've noticed in the publish web window validate connection yields failed and once clicked yields the same error
But it has not resolved the issue.
Anyone any ideas what may be causing the error?

Web deployment task failed. The maximum number of connections for this site has been exceeded. Azure

I am get error below on publish to azure using web deploy profile i downloaded from azure website
Web deployment task failed. (The maximum number of connections for this site has been exceeded. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEEDED_MAX_SITE_CONNECTIONS.)
I am using visual studio 2012
I was having the same issue but after restarting management service it worked for me.
Here are the steps:
Go to your windows server where IIS Server configured.
Control Panel => System and Security => Administrative Tools => Services.
In the Services. Restart Web Deployment Agent Service and Web Management Service
Give a try now to web deploy.
This may occur if you are connecting to the internet via a 3G dongle or card.
I have the same error and earlier in my warnings was "Retrying the sync because a socket error (10054) occurred" I'm stuck on a 3G connection today and getting this for the 1st time so presume these are related.
I know that it's been a long time ago, but I was struggling with the same issue lately. For me, it helped to restart the Web Management Service.
It might hang in Stopping status - if so, you can forcibly kill it:
First, open cmd with elevated privileges, and use sc queryex wmsvc command to find out the PID of the service.
Then, use taskkill /PID [the pid] /F command to kill the process. After that, you just start it again with services.msc
Hope it'll help :)
I had a similar problem trying to publish a WebSite on Azure. I solved it by restarting the website from azure management. If you're deploying to IIS, I suggest to try a restart or a stop and start for your website and try publishing again.

Resources