Publish-AzWebApp : One or more errors occurred. System.Net.WebException: The remote server returned an error: (502) Bad Gateway

Meghana Kasal Vinayakumar 1 Reputation point
2021-02-27T01:00:14.587+00:00

I am trying to publish the code via zip deployment using powershell (Please note that I can only use powershell in my system). When I deploy, I get the following error: Publish-AzWebApp : One or more errors occurred. At line:1 char:1 + Publish-AzWebApp -ResourceGroupName FleetMetricsTracking -Name Assemb ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Publish-AzWebApp], AggregateException + FullyQualifiedErrorId : Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet DEBUG: AzureQoSEvent: CommandName - Publish-AzWebApp; IsSuccess - False; Duration - 00:00:01.1815709; Exception - System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet.<>c__DisplayClass13_0.<ExecuteCmdlet>b__0() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ConfirmAction(Boolean force, String continueMessage, String processMessage, String target, Action action, Func1 useShouldContinue) at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.ConfirmAction(Boolean force, String continueMessage, String processMessage, String target, Action action) at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.PublishAzureWebAppCmdlet.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() ---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace ---<--- ; DEBUG: Finish sending metric. DEBUG: 4:25:43 PM - PublishAzureWebAppCmdlet end processing. I am not sure what should be done. Can anyone help?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,257 questions
{count} votes