Lymedo
Lymedo

Reputation: 608

Azure Function v2 Web Deploy experienced a connection problem with the server and had to terminate the connection

When trying to publish a V2 function from Visual Studio I'm getting a publish error:

Publish has encountered an error. Publishing failed.

The messages from the Output windows are:

Web deployment task failed. (Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Unexpected end of file has occurred. The following elements are not closed: results. Line 1, position 550.

The contents of the diagnostics log are:

06/05/2019 11:32:37 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.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.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.d__183.MoveNext() ---> (Inner Exception #0) System.Exception: Publishing failed.<---

I have created a new HTTP function, tested it locally and the attempted to publish it.

Anyone know how to fix this?

Upvotes: 4

Views: 2212

Answers (1)

Lymedo
Lymedo

Reputation: 608

Found the fix to this problem by walking through the quick start guide (again):

Publish the Project to Azure

You need to select the option for "Run from package file (recommended)".

Upvotes: 1

Related Questions