6

我有 3 个 web 部署(Visual Studio 发布项目到包)包,我使用 msdeploy 命令与服务器同步。其中一个包是新添加的。除了新添加的一个之外,其他两个包都可以正常工作。我在日志中看到以下错误。我不确定在哪里设置权限,因为 iisApp 提供程序的权限已经在 IIS 管理器委派设置中设置。我是 IIS 配置和 .net 开发的新手。谁能提供有关我为什么会收到此错误的信息?

这是使用的命令:

PS D:\Deployment> &'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'  -verb:sync -source:package='D:\temp\CI.Web.Pack_20130824.1\_PublishedWebsites\ProjectXYZ_Package\
ProjectXYZ.zip' -dest="auto,computerName='https://localhost:8172/msdeploy.axd?site=siteName',username
='deployUserName',password='deployPassword',authType=basic,includeAcls='False'" -skip:objectName=createApp -disableLink:AppPoolExtens
ion -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted
Info: Using ID '2b0c6151-a2b0-4a87-9135-263330c5e619' for connections to the remote server.
Info: Object createApp (D:\Builds\2\Mayo.KCMS\CI.Web.Pack\Sources\DEV\Web\ProjectXYZ\obj\Rele
ase\Package\PackageTmp) skipped due to skip directive 'CommandLineSkipDirective 1'.
Info: Adding sitemanifest (sitemanifest).
Info: Adding IIS Application (Default Web Site/ProjectXYZ_deploy)
Error Code: ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP
More Information: Could not complete an operation with the specified provider ("iisApp") when connecting using the Web M
anagement Service. This can occur if the server administrator has not authorized the user for this operation. iisApp htt
p://go.microsoft.com/fwlink/?LinkId=178034  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_
AUTHORIZED_FOR_IISAPP.
Error count: 1.

服务器上的错误:

wmsvc.exe Error: 0 : User: 
Client IP: ::1
Content-Type: application/msdeploy
Version: 9.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 9.0.1631.0
MSDeploy.Method: Sync
MSDeploy.RequestId: 6b694745-0024-416c-9439-3e97608417b9
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
ServerVersion: 9.0.1631.0
Skip: objectName="^configProtectedData$"objectName="createApp"
Provider: auto, Path: 
A tracing deployment agent exception occurred that was propagated to the client. Request ID '6b694745-0024-416c-9439-3e97608417b9'. Request Timestamp: '8/26/2013 2:01:55 PM'. Error Details:
ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP
Microsoft.Web.Deployment.DeploymentDetailedUnauthorizedAccessException: Could not complete an operation with the specified provider ("iisApp") when connecting using the Web Management Service. This can occur if the server administrator has not authorized the user for this operation. iisApp http://go.microsoft.com/fwlink/?LinkId=178034  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP.
   at Microsoft.Web.Deployment.DelegationHelper.ImpersonateForOperation(String deploymentAction, String deploymentProvider, String deploymentPath, DelegationContextCache cache)
   at Microsoft.Web.Deployment.DelegationHelper.ImpersonateForOperation(String deploymentAction, DeploymentObject deploymentObject)
   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.SyncChildren(DeploymentObject dest, DeploymentObject source)
   at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(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)
   at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId)
   at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
   at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)

在此处输入图像描述

4

4 回答 4

8

我已经找到了问题的解决方案。第三个包试图在服务器上创建一个新应用程序,因为应用程序名称与其他两个包不同。我添加了一个新的 setParameters.xml 文件,其中包含应用程序名称的条目,它将用前两个包部署到的应用程序名称覆盖默认应用程序名称。我将此 setParameters.xml 文件作为参数传递给 Webdeploy 命令。

&'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'  -verb:sync -source:package='D:\temp\Project_XYZ.zip' -setParamFile:setParameters.xml -dest="auto,computerName='https://localhost:8172/msdeploy.axd?site=siteName',username='deployUser',password='changeMe',authType=basic,includeAcls='False'" -skip:objectName=createApp -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted -whatif

设置参数.xml

<?xml version="1.0" encoding="utf-8"?>
<parameters>
  <setParameter name="IIS Web Application Name" value="siteName" />
</parameters>
于 2013-09-03T14:26:46.013 回答
4

除非用户是管理员,否则您需要授予他们访问网站的权限。您可以通过在 IIS 管理器中右键单击该网站并选择Deploy :: Configure Web Deploy Publishing. 只需选择用户并单击确定(您可以删除它在桌面上生成的发布设置文件)

于 2013-09-03T11:58:10.357 回答
1

当我进行非管理员部署时,我遇到了这个确切的问题。这是收到“ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP”错误后的有效命令行。这消除了通过使用 -setParam 来引用外部 setParams.xml 的需要

可悲的是,在 setParams 和计算机名字符串中对“站点名称”的双重引用使这项工作有效。我尝试消除其中一个,但我总是会收到“ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP”错误。

`"c:\program files\iis\microsoft web deploy v3\msdeploy"  -verb:sync -setParam:'IIS Web Application Name'='sitename' -source:package="package.zip" -dest:auto,computerName='https://machinename:8172/msdeploy.axd?site=sitename',username=username,password=password, -allowUntrusted=true`
于 2019-03-22T14:34:08.023 回答
0

我通过卸载然后重新安装 Web Deploy(都通过运行 Web Deploy 安装程序)解决了这个问题。

请参阅此问题及其答案,了解似乎相同或至少相似的问题:

于 2017-11-06T16:37:07.650 回答