I encounter an error while deploying a package on an azure web app.
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. ---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070005. ---> 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.<DownloadAndDeployPackage>d__b.MoveNext()'</message>
</entry>
</entries>
It seems like the azure resource group is trying to recreate my local folders hierarchy on the azure web app.
On the other side, using a package created with Visual Studio --> Publish --> Package works fine. Manually creating the package from VS is not an option, and I can't understand why it fails when msdeploy.exe is used !!