Azure功能应用程序 - 发布失败

问题描述 投票:8回答:6

我无法发布(WebDeploy)我的Azure功能应用程序(这是一个持久的功能,我知道它无关紧要,但是,万一是有意义的话)。这开始发生在今天。

我在Visual Studio的输出窗口中收到“Publish Failed”弹出窗口和以下错误消息。

错误信息

<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.

函数运行时 - beta

当我在浏览器中访问功能应用程序URL时,我得到“你的功能应用程序2.0预览已启动并运行”消息“。而且,我在Kudu门户网站上也没有看到任何错误。

我删除了函数,并使用相同的名称重新创建它,没有运气。

任何帮助深表感谢。

更新:这是我得到的另一个错误。

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.

谢谢,Praveen

azure azure-functions webdeploy
6个回答
5
投票

不知道这是否已关闭,但在将新SDK版本部署到较旧的azure功能应用程序时遇到了同样的问题。这就是我所做的:不是从Azure门户下载部署配置文件,而是使用visual studio自动部署创建了一个新配置文件。这很重要 - 从Visual Studio部署时,它应该要求您升级已部署应用程序的版本,单击是,您的应用程序将被部署。


2
投票

将WebDeploy与SCM一起使用时无法重现您的错误。当我将WEBSITE_WEBDEPLOY_USE_SCM设置为false(在应用程序设置中)以避免使用SCM时,我看到An error was encountered when processing operation 'Create Directory' on 'wwwroot'就像你遇到的第二个错误。

有几种选择:

  1. 在浏览器中访问https://functionappname.scm.azurewebsites.net以检查您的网络环境是否正常并且没有防火墙限制。
  2. 发布时检查是否有像Fiddler这样的代理集。
  3. 去门户网站,Reset publish credentials然后Download publish profile。删除旧的发布配置文件并导入新的配置文件以再次发布。
  4. 如果所有这些建议都失败,请删除与该功能相关的所有旧资源。然后使用新的应用服务计划和存储创建一个全新的功能应用。尝试发布到这个新的应用程序。

1
投票

转到azure portal,停止功能应用,从vs发布,然后重新开始。


0
投票

我很容易错过...但Azure上的功能阻止了我从Visual Studio 2017发布。

需要的是重新启动Azure上的功能。

1)转到Azure门户并单击您的功能应用程序。

2)单击Function的名称,然后在Overview选项卡中 - 在第二行菜单中,您应该看到Restart。 (您将在行中看到它:停止 - 交换 - 重新启动 - 获取发布配置文件等。)

3)单击“重启”

4)返回Visual Studio 2017并重新发布。

我最初错过的错误消息:

C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Web Deploy cannot modify the file 'MyApp.Functions.dll' on the destination because it is locked by an external process.  In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.) [C:\Github\2019AzureBlobLocalOnly\MyApp.Functions\MyApp.Functions.csproj]

0
投票

当我因为某些原因需要进行更改时,这似乎发生在我身上。

  1. 重建项目(确保您可以在本地运行它)。
  2. 单击以发布,但在此之前单击“管理应用程序设置”进行快速检查并单击“确定”。
  3. 尝试发布。
  4. 如果失败则关闭visual studio和azure portal(停止运行或禁用所有相关对象)并重复。

最坏的情况是创建一个新的配置文件并进行部署。


-1
投票

与@Andrew Chung类似的问题,Azure中的文件存在锁定,无法删除旧的函数dll文件。我试图升级到.NET核心并从另一个项目发布。不幸的是,我没有看到他的反应,直到为时已晚,并且按照@Jerry Liu的建议(#4)删除了功能应用程序并添加了新功能。在我用不同的名称重新创建应用程序之前,这对我来说似乎不起作用。我怀疑可能存在DNS冲突,其中xxxx.scm.azurewebsites.net仍然指向旧的退役应用程序的IP地址。

© www.soinside.com 2019 - 2024. All rights reserved.