I'm trying to setup automatic deployment using msbuild.
I succeeded having a msdeploy sync call to successfully publish a zip package created with msbuild.
However when I try to perform a msdeploy delete call prior to the sync operation it fails with
ERROR_USER_NOT_AUTHORIZED_FOR_DEPLOYMENTPROVIDER
Is there any permissions or additional IIS delegation rules that should be set compared to the one used for the sync call ?
The msdeploy -verb:sync
works correctly:
Total changes: 676 (672 added, 0 deleted, 4 updated, 0 parameters changed, 55787329 bytes copied)
Syncing done.
Howerver the msdeploy -verb:delete
fails:
Info: Using ID '138cbadf-3449-4574-8e3f-0a3bd13fe751' for connections to the remote server.
EXEC : error Code: ERROR_USER_NOT_AUTHORIZED_FOR_DEPLOYMENTPROVIDER [c:\PATH\Deploy.proj]
More Information: Could not complete an operation with the specified provider ("auto") when connecting using the Web Management Service. This can o
ccur if the server administrator has not authorized the user for this operation. auto http://go.microsoft.com/fwlink/?LinkId=178034
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_AUTHORIZED_FOR_DEPLOYMENTPROVIDER.
As you can see I'm using a msbuild proj file to to this. The msdeploy calls are performed with the <Exec>
rule :
<Target Name="Publish" >
<Message Importance="High" Text="Deleting from $(PublishServer) ..." />
<!-- THIS FAILS: -->
<Exec
WorkingDirectory="$(MsDeployBinaryFolder)\"
Command=""$(MsDeployBinary)" -verb:delete -dest:auto,computerName="https://$(PublishServer):8172/msdeploy.axd?Site=$(IisAppHostName)",authType=Basic,userName=$(UserName),password='$(Password)' -allowUntrusted -disableLink:ContentExtension -disableLink:AppPoolExtension"
/>
<Message Importance="High" Text="Deletion done." />
<Message Importance="High" Text="Syncing to $(PublishServer) ..." />
<!-- THIS WORKS: -->
<Exec
WorkingDirectory="$(MsDeployBinaryFolder)\"
Command=""$(MsDeployBinary)" -verb:sync -source:package="$(ArchiveDir)\$(SiteName)\$(SiteName).zip" -dest:auto,computerName="https://$(PublishServer):8172/msdeploy.axd?Site=$(IisAppHostName)",authType=Basic,userName=$(UserName),password='$(Password)' -allowUntrusted -setParam:"IIS Web Application Name"="$(IisAppHostName)/$(IisSiteName)""
/>
<Message Importance="High" Text="Syncing done." />
</Target>
Any idea why sync can add and alter files while delete fails ?