Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Function App - Publish failed

I'm unable to publish (WebDeploy) my Azure Function App (It's a Durable Function, I know it deosn't matter, but, just in case if matters). This started happening today.

I'm getting a "Publish Failed" popup and the below error message in the output window of my Visual Studio.

Error Message

<ProjectName> -> C:\search\source\<Solution Folder>\obj\Release\netstandard2.0\PubTmp\Out\
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Web deployment task failed. (Could not connect to the remote computer ("<functionappname>.scm.azurewebsites.net"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.) [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : The requested resource does not exist, or the requested URL is incorrect. [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Error details: [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Could not connect to the remote computer ("<functionappname>.scm.azurewebsites.net"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE. [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : The remote server returned an error: (404) Not Found. [<projectname>.csproj]
  Publish failed to deploy.

Function Runtime - beta

When I access the Function App Url in a browser I get "Your Function App 2.0 preview is up and running" message". And, I don't see anything wrong in the Kudu portal as well.

I have deleted the Function and re-created it with the same name with no luck.

Any help is much appreciated.

Update : Here is another error that I'm getting as well.

C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Web deployment task failed. ((7/25/2018 1:16:27 PM) An error occurred when the request was processed on the remote computer.) [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error :  [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : (7/25/2018 1:16:27 PM) An error occurred when the request was processed on the remote computer. [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : An error was encountered when processing operation 'Create Directory' on 'D:\home\site\wwwroot\bin'. [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : The error code was 0x800703E6. [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Invalid access to memory location. [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error :  [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error :    at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath) [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error :    at Microsoft.Web.Deployment.FileSystemInfoEx.set_Attributes(FileAttributes value) [<Project Name>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error :    at Microsoft.Web.Deployment.DirPathProviderBase.Add(DeploymentObject source, Boolean whatIf) [<Project Name>.csproj]
  Publish failed to deploy.

Thanks, Praveen

like image 303
Prawin Avatar asked Jul 25 '18 12:07

Prawin


People also ask

How do I publish a function app in Azure?

Use the following steps to publish your project to a function app in Azure. In Solution Explorer, right-click the project and select Publish. In Target, select Azure then Next. Select Azure Function App (Windows) for the Specific target, which creates a function app that runs on Windows, and then select Next.

What is Website_run_from_package?

Using WEBSITE_RUN_FROM_PACKAGE = URL. This section provides information about how to run your function app from a package deployed to a URL endpoint. This option is the only one supported for running from a package on Linux hosted in a Consumption plan.


1 Answers

I fixed this issue by setting WEBSITE_RUN_FROM_PACKAGE to 0 on the application settings. I was uploading the function files by syncing a WebDeploy package from Azure DevOps to the App Service file system and not running it from the .zip package.

On https://docs.microsoft.com/bs-cyrl-ba/azure/azure-functions/run-functions-from-deployment-package explains about running Functions from a deployment package and all the benefits of doing it this way, but then remember to:

  1. Just upload the .zip deployment package to d:\home\data\sitepackages (don't use the msdeploy verb "sync" to sync the file system at wwwroot)
  2. Add a packagename.txt containing only the name of the package file in folder, without any whitespace
like image 73
David Rodriguez Avatar answered Oct 13 '22 20:10

David Rodriguez