Background I had published a .NetCore2 project to an Azure App Service via a build pipeline in Azure Dev Ops.
However I encountered this issue trying to navigate to the api/values link This link does work on localhost.
In order to create a web.config with the values needed, I thought I should try right clicking the Project in the .sln and Deploying it .
Note I was using 2 app services, not trying to overwrite one.
I received the error
Severity Code Description Project File Line Suppression State
Error Web deployment task failed. (Could not connect to the remote computer ("myproj.scm.azurewebsites.net") using the specified process ("Web Management Service"). This can happen if a proxy server is interrupting communication with the destination server. Disable the proxy server and try again. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_PROXY_GATEWAY.)
Make sure firewall and network settings on your computer and on the server are configured to allow connections between them. If the issue is not resolved, please contact your local or server administrator.
Error details:
Could not connect to the remote computer ("myproj.scm.azurewebsites.net") using the specified process ("Web Management Service"). This can happen if a proxy server is interrupting communication with the destination server. Disable the proxy server and try again. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_PROXY_GATEWAY.
The remote server returned an error: (502) Bad Gateway. myproj C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets 139
( where myproj indicates the project name )
[Update]
I stopped the app service belonging to the devops pipeline, cleaned the project, re-built the solution and re-published it successfully.
I aren't sure why or whether stopping the service was necessary.
I have since restarted and re-deployed both services.