错误在msdeploy包Azure的Web应用程序部署 [英] ERROR on Azure Web App Deployment of a msdeploy package

查看:490
本文介绍了错误在msdeploy包Azure的Web应用程序部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个错误,而在一个蓝色的web应用程序部署包。

I encounter an error while deploying a package on an azure web app.

该应用程序是一个.NET Web应用程序,编为4.0的框架。

The app is a .NET web application, compiled for 4.0 framework.

下面是我用于创建包的命令行:

Here is the command line I use for creating the package:

"msdeploy.exe" -verb:sync -source:dirpath="C:\Users\Pierre\Documents\Projets\MyProject\MyApp" -dest:package=C:\Users\Pierre\Documents\MyProject\AzureResourceGroup\MyApp.zip

然后,使用蔚蓝资源组模板部署我得到以下错误

Then, on deployment using azure resource groups templates I get the following error

<?xml version="1.0" encoding="utf-8"?>
<entries>
  <entry time="2016-01-06T09:55:20.4679645+00:00" type="Message">
    <message>Downloading metadata for package path 'artifacts/MyApp.zip' from blob 'https://ccfstoragee57wqq4suhjoy.blob.core.windows.net'</message>
  </entry>
  <entry time="2016-01-06T09:55:20.5148382+00:00" type="Message">
    <message>The blob has flag IsPremiumApp:. IsPremiumApp returns False</message>
  </entry>
  <entry time="2016-01-06T09:55:20.5617164Z" type="Message">
    <message>Downloading package path 'artifacts/MyApp.zip' from blob 'https://ccfstoragee57wqq4suhjoy.blob.core.windows.net'</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6280976Z" type="Message">
    <message>No parameters were populated.</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6280976Z" type="Message">
    <message>Calling SyncTo() on package.</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6280976Z" type="Message">
    <message>Adding MSDeploy.dirPath (MSDeploy.dirPath).</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6280976Z" type="Message">
    <message>Adding MSDeploy.dirPath (MSDeploy.dirPath).</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6280976Z" type="Message">
    <message>Adding directory (C:\Users\Pierre\Documents\Projets\MyProject\MyApp).</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6280976Z" type="Message">
    <message>Adding directory (C:\Users\Pierre\Documents\Projets\MyProject\MyApp).</message>
  </entry>
  <entry time="2016-01-06T09:55:30.6593714Z" type="Error">
    <message>Package deployment failed</message>
  </entry>
  <entry time="2016-01-06T09:55:30.7267862Z" type="Error">
    <message>AppGallery Deploy Failed: 'Microsoft.Web.Deployment.DeploymentDetailedUnauthorizedAccessException: Unable to perform the operation ("Create Directory")  for the specified directory ("C:\Users\Pierre\Documents\Projets\MyProject\MyApp"). This can occur if the server administrator has not authorized this operation for the user credentials you are using.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER. ---&gt; Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070005. ---&gt; System.UnauthorizedAccessException: Access to the path 'C:\Users' is denied.
   at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
   at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path)
   at Microsoft.Web.Deployment.DirPathProviderBase.CreateDirectory(String fullPath, DeploymentObject source)
   at Microsoft.Web.Deployment.DirPathProviderBase.Add(DeploymentObject source, Boolean whatIf)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at Microsoft.Web.Deployment.FilePathProviderBase.HandleKnownRetryableExceptions(DeploymentBaseContext baseContext, Int32[] errorsToIgnore, Exception e, String path, String operation)
   at Microsoft.Web.Deployment.DirPathProviderBase.Add(DeploymentObject source, Boolean whatIf)
   at Microsoft.Web.Deployment.DeploymentObject.Add(DeploymentObject source, DeploymentSyncContext syncContext)
   at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject)
   at Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject, DeploymentObject sourceObject)
   at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
   at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)
   at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
   at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(String provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentWellKnownProvider provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
   at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.Deploy(String deploymentSite, String siteSlotId)
   at Microsoft.Web.Deployment.WebApi.DeploymentController.&lt;DownloadAndDeployPackage&gt;d__b.MoveNext()'</message>
  </entry>
</entries>

这似乎是蔚蓝的资源组试图重新我的本地文件夹上蔚蓝的Web应用程序的层次结构。

It seems like the azure resource group is trying to recreate my local folders hierarchy on the azure web app.

另一方面,使用与Visual Studio中创建一个包 - >发布 - >包装工作正常。手动创建从VS包是不是一种选择,我不明白为什么当使用msdeploy.exe失败!

推荐答案

在这里同样的问题。
在挣扎了好几天,现在,已经查明的问题是在序列化和连接codeD MSDeploy.MSDeployProviderOptions属性在archive.xml值。值包含从打包文件的原始文件夹结构,以及Web部署在Azure中尝试重新创建在目标系统上相同的结构。
运行带有-replace选项msdeploy当创建一个包,对这些序列化选项绝对没有影响(可能是msdeploy一个bug?)。

Same issue here. Been struggling for several days now, and have pinpointed the problem to be in the serialized and encoded MSDeploy.MSDeployProviderOptions attribute value in archive.xml. The value contains the original folder structure from which the packaged files originated, and Web Deploy in Azure attempts to recreate the same structure on the target system. Running msdeploy with the "-replace" option when creating a package has absolutely no effect on those serialized options (could be a bug in msdeploy?).

更新

下面就是终于为我工作:

Here's what finally worked for me:

msdeploy.exe
   -source:iisApp='C:\Users\alex\AppData\Local\Temp\PublishTemp\TheWorldVS47\wwwroot'
   -dest:package='C:\Code\TheWorldVS\PublishOutput\package.zip' 
   -verb:sync 
   -enableLink:contentLibExtension 
   -replace:match='C:\\Users\\alex\\AppData\\Local\\Temp\\PublishTemp\\TheWorldVS47\\',replace='website\' 
   -retryAttempts:2 
   -disablerule:BackupRule 
   -declareParam:name="IIS Web Application Name",kind="ProviderPath",scope="IisApp",match="^C:\\Users\\alex\\AppData\\Local\\Temp\\PublishTemp\\TheWorldVS47",defaultValue="website"

这最后的设置是什么使得它在Azure的指示MSDeploy了那么长的本地路径的任何事件必须以网在默认情况下被替换工作。
我想你也可以进一步通过在MSDeploy扩展块的setParameters属性中的ARM JSON模板,它提供了一个覆盖自定义值。

This last setting is what made it work by instructing MSDeploy in Azure that any occurrences of that long local path must be replaced with "website" by default. I suppose you could also further customize that value by providing an override for it in the ARM json template within the setParameters property of your MSDeploy extension block.

这篇关于错误在msdeploy包Azure的Web应用程序部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆