Failed to deploy web package to App Service. Service Unavailable (CODE: 503) - azure-web-app-service

I am trying to deploy my app to an Azure app service via Azure Dev Ops pipelines. The app builds okay, but during the deploy phase, I get the following error.
2023-01-12T19:23:13.1683884Z ##[error]Failed to deploy web package to App Service.
2023-01-12T19:23:13.1696403Z ##[error]Error: Error: Failed to deploy web package to App Service. Service Unavailable (CODE: 503)
It has failed consistently multiple times in a row, after working fine for the past couple of weeks.
Full log
2023-01-12T19:21:10.6967333Z ##[section]Starting: Deploy
2023-01-12T19:21:10.6981944Z ==============================================================================
2023-01-12T19:21:10.6982213Z Task : Azure App Service deploy
2023-01-12T19:21:10.6982366Z Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2023-01-12T19:21:10.6982681Z Version : 4.214.0
2023-01-12T19:21:10.6982809Z Author : Microsoft Corporation
2023-01-12T19:21:10.6982961Z Help : https://aka.ms/azureappservicetroubleshooting
2023-01-12T19:21:10.6983137Z ==============================================================================
2023-01-12T19:21:11.2444263Z Got service connection details for Azure App Service:'REDACTED'
2023-01-12T19:22:18.8337786Z Package deployment using ZIP Deploy initiated.
2023-01-12T19:23:13.1683884Z ##[error]Failed to deploy web package to App Service.
2023-01-12T19:23:13.1696403Z ##[error]Error: Error: Failed to deploy web package to App Service. Service Unavailable (CODE: 503)
2023-01-12T19:23:13.9090032Z Successfully added release annotation to the Application Insight : [REDACTED]
2023-01-12T19:23:14.0064590Z ##[warning]Error: Failed to update deployment history. Error: Service Unavailable (CODE: 503)
2023-01-12T19:23:14.2708516Z App Service Application URL: https://REDACTED.azurewebsites.net
2023-01-12T19:23:14.2790032Z ##[section]Finishing: Deploy
I tried to redeploy an older release that previously worked, but I got the same errors.
I also tried to publish to my app service from Visual Studio. It failed with the following error.
Error MSB4018: The "ZipDeploy" task failed unexpectedly.
Full Error
Error MSB4018: The "ZipDeploy" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.BeginReceive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
--- End of inner exception stack trace ---
at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.EndRead(IAsyncResult asyncResult)
at System.Net.Http.StreamToStreamCopy.StartRead()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.NET.Sdk.Publish.Tasks.ZipDeploy.HttpClientHelpers.<PostWithBasicAuthAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.NET.Sdk.Publish.Tasks.ZipDeploy.ZipDeploy.<ZipDeployAsync>d__26.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.NET.Sdk.Publish.Tasks.ZipDeploy.ZipDeploy.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
---> (Inner Exception #0) System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.BeginReceive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
--- End of inner exception stack trace ---
at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.EndRead(IAsyncResult asyncResult)
at System.Net.Http.StreamToStreamCopy.StartRead()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.NET.Sdk.Publish.Tasks.ZipDeploy.HttpClientHelpers.<PostWithBasicAuthAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.NET.Sdk.Publish.Tasks.ZipDeploy.ZipDeploy.<ZipDeployAsync>d__26.MoveNext()<---
Could this a temporary problem with the zip deployment service? The Azure service status page doesn't currently show any issues.

Turns out my App Service was overloaded. I scaled-up to the next plan, and I was able to deploy again.

Related

Azure Sphere CLI - The device is not responding

I cannot deploy azure sphere sample to my device. It was working, but after update to new Azure Sphere SDk version, it suddenly stops working.
I have same the SDk version on my second computer and there it works fine. I tried to delete cache, reinstall Azure Sphere SDK, restart the Azure Sphere Device Communication Service, reinstall of drivers for USB serial converters, check TAP-Windows adapter, check Cisco AnyConnect VPN client, remove config file, run azsphere device recover.
CMD azsphere device list-attached
1 device attached:
--> Device ID: eaddb5f...
--> Is responsive: yes
--> IP address: 192.168.35.2
--> Connection path: 113
Azure Sphere Classic developer Command Prompt (Deprecated) azsphere device list-attached
1 device attached:
error: The device is not responding. The device may be unresponsive if it is applying an Azure Sphere operating system update; please retry in a few minutes.
--> Device ID: Cannot get device ID
--> Is responsive: no
--> IP address: 192.168.35.2
--> Connection path: 113
Azure Sphere Classic developer Command Prompt (Deprecated) azsphere device recover -v -diag
verbose: Azure Sphere Utility version 22.2.3.41775
verbose: Copyright (C) Microsoft Corporation. All rights reserved.
verbose:
verbose: Start time (UTC): Thursday, 24 March 2022 10:20:42
Downloading recovery images...
verbose: Downloading https://prod.releases.sphere.azure.net/recovery/mt3620an.zip to C:\Users\marti\AppData\Local\Temp\AzureSphereRecoveryImages\77d2823e-fae1-4809-9f06-a5809932e454\mt3620an.zip.
error: Device recovery failed: Unable to download recovery images for chip 'mt3620an'. Check your network connection.
trace: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8888
trace: at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
trace: at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
trace: at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
trace: --- End of inner exception stack trace ---
trace: at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
trace: at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
trace: at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
trace: --- End of stack trace from previous location where exception was thrown ---
trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
trace: at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
trace: at Microsoft.Azure.Sphere.Tools.Common.Download.RecoveryImageDownloader.<DownloadAsync>d__1.MoveNext()
trace: --- End of stack trace from previous location where exception was thrown ---
trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
trace: at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
trace: at Microsoft.Azure.Sphere.Tools.Commands.DeviceRecoverCommand.<RetrieveImagesAsync>d__70.MoveNext()
verbose: Command completed in 00:00:02.4889126.

Win 10 -> VS 2019 -> .NET Core 3 WPF application -> Publish to directory (self-contained for linux-x64) -> Publish failed

Weird issue I've faced today.
Pre-requisites:
Installed:
VS2019
.NET Core 3.0
Steps to reproduce the issue:
Create new "WPF App (.NET Core)"
To the MainWindow.xaml add single TextBlock:
<TextBlock Text="WPF on Linux" TextWrapping="Wrap"/>
Create new Publish Profile like the following:
Then save and publish
Expected to see the application being published. But instead the following message pops up:
And here is the content of the mentioned in the error message file:
2019-10-28 19:39:43
System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__202.MoveNext()
---> (Inner Exception #0) System.Exception: Publishing failed.<---
System.Exception: Publishing failed.
===================
The question is.. What am I doing wrong and/or how to fix the issue?
Important note:
If Deployment Mode is set to "Framework Dependent", and the Target Runtime is "linux-x64" then the project is published into the directory with no issues.
If Deployment Mode is set to "Self-contained", but Target Runtime is "win-x64", then deployment works with no issues.
The error is in the build output window:
There was no runtime pack for Microsoft.WindowsDesktop.App.WPF available for the specified RuntimeIdentifier 'linux-x64'
WPF is not supported on Linux, only Windows.

Dotnet Core 2.0 Web App Publish to Azure Fails

From VS 2017
what I tried:
Build in release mode & debug mode both builds fine.
Set Build verbosity to Diagnostic, there is not much information
indicating code error.
However .tmp dump file indicates some error.
I suspect these are visual studio internal errors:
5/4/2018 9:34:44 PM
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__88.MoveNext()
---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---
===================
Setting RazorCompileOnBuild property to true should resolve your problem.
Take a look on following question
Had to set build verbosity to diagnostics then found out there were some errors in un-used Razor view pages.
There must be a way to compile Razor during build time rather than when publishing.

Azure + Bitbucker Error on WebSocket

I'm trying to configure Bitbucket as Deployment source for a Web App.
This App is inside a Application Service Environment v2 that is "blocked" from the outside so I can't deploy from Visual Studio.
When I try to connect bitbucket I get this error:
Failed to set up deployment source for web app almondstech, using Bitbucket. {"Code":"BadRequest","Message":"Repository 'UpdateSiteSourceControl' operation failed with Microsoft.Web.Hosting.SourceControls.OAuthException: Bitbucket AddWebHook: (400) BadRequest.
at Microsoft.Web.Hosting.SourceControls.BitbucketV2Proxy.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
t System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Web.Hosting.Administration.BitbucketV2SiteRepositoryProvider.d__6.MoveNext()
'UpdateSiteSourceControl' operation failed with Microsoft.Web.Hosting.SourceControls.OAuthException: Bitbucket AddWebHook: (400) BadRequest. at Microsoft.Web.Hosting.SourceControls.BitbucketV2Proxy.d__41.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at
I already tried to remove / add again the App on Bitbucket and with several browsers, always with the same result.
Thanks

.NET Core deployment to IIS error for the standard .NET Core web application

I am trying to deploy a .NET Core 2.0 application to IIS. This is just the standard .NET Core web application that is created when starting a new project. The project builds and run just fine. However, when trying to publish to IIS via web deploy, I get the following error:
3/25/2018 3:45:08 PM
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__88.MoveNext()
---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---
===================
Am I missing something?

Resources