Azure Web App Deploy - Physical Path Above WWWRoot

I need to run an Application Host transform on an Azure website (http://stackoverflow.com/questions/31427635/applicationhost-config-azure-web-app) but it looks like the Azure Web App Deploy deployment step is locked into the wwwroot folder. I tried to use “…” but the step failed:

== Failed: Step 5: ProjectName ==
13:10:00   Verbose  |     Octopus Server version: 3.3.3+Branch.master.Sha.2209e2178b76e96901b269b75102e81bdb8836eb
13:10:00   Verbose  |     Using account ID 'azuresubscription-c1-labs-development'
13:10:01   Verbose  |     Octopus Deploy: Calamari.Azure version 3.3.3+Branch.master.Sha.fa6cdb818cc61981999e8e702687e6c09ed18703
13:10:01   Info     |     Deploying package:    E:\Octopus\OctopusServer\PackageCache\feeds-proget-artifacts\ProjectName.6.3.35-dev_4CD5E82D114B754F92DA92A9E1E0BDDF.nupkg
13:10:01   Verbose  |     Extracting package to: E:\Octopus\Work\20160317171000-254
13:10:01   Verbose  |     Extracted 15 files
13:10:01   Info     |     Performing variable substitution on 'E:\Octopus\Work\20160317171000-254\wwwroot\scripts\scripts.39b8b199.js'
13:10:01   Info     |     Performing variable substitution on 'E:\Octopus\Work\20160317171000-254\wwwroot\scripts\vendor.26e51b66.js'
13:10:04   Info     |     Deploying to Azure WebApp 'ProjectSiteName(Staging)' using subscription-id '19ef690e-9587-4827-b3c6-d2e12ae0206d'
13:10:06   Verbose  |     Retrieving publishing profile...
13:10:07   Verbose  |     Retrieved publishing profile: URI: ProjectSiteName-staging.scm.azurewebsites.net:443  UserName: $ProjectSiteName__Staging
13:10:07   Verbose  |     Using ID '56dc4b1a-ce3c-4075-a2dc-abcfed344bb4' for connections to the remote server.
13:10:07   Verbose  |     Pre-authenticating to remote agent URL 'https://ProjectSiteName-staging.scm.azurewebsites.net/msdeploy.axd?site=ProjectSiteName(Staging)' as '$ProjectSiteName__Staging'.
13:10:10   Verbose  |     Performing synchronization pass #1.
13:10:10   Verbose  |     Pre-authenticating to remote agent URL 'https://ProjectSiteName-staging.scm.azurewebsites.net/msdeploy.axd?site=ProjectSiteName(Staging)' as '$ProjectSiteName__Staging'.
13:10:11   Verbose  |     Received response from agent (HTTP status 'OK').
13:10:11   Verbose  |     Adding MSDeploy.contentPath (MSDeploy.contentPath).
13:10:11   Verbose  |     Adding virtual path (ProjectSiteName(Staging)\../)
13:10:11   Verbose  |     Source dirPath (E:\Octopus\Work\20160317171000-254) does not match destination (ProjectSiteName(Staging)\../) differing in attributes (securityDescriptor,parentSecurityDescriptors,attributes). Update pending.
13:10:11   Verbose  |     Adding directory (ProjectSiteName(Staging)\../).
13:10:11   Error    |     Microsoft.Web.Deployment.DeploymentException: (3/17/2016 1:10:11 PM) An error occurred when the request was processed on the remote computer. ---> Microsoft.Web.Deployment.DeploymentClientServerException: An error was encountered when processing operation 'Create Directory' on 'D:\home\site\wwwroot\..'. ---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x800700A1. ---> System.IO.IOException: The specified path is invalid.
13:10:11   Error    |     at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
13:10:11   Error    |     at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path)
13:10:11   Error    |     at Microsoft.Web.Deployment.DirPathProviderBase.CreateDirectory(String fullPath, DeploymentObject source)
13:10:11   Error    |     at Microsoft.Web.Deployment.DirPathProviderBase.Add(DeploymentObject source, Boolean whatIf)
13:10:11   Error    |     --- End of inner exception stack trace ---
13:10:11   Error    |     --- End of inner exception stack trace ---
13:10:11   Error    |     --- End of inner exception stack trace ---
13:10:11   Error    |     at Microsoft.Web.Deployment.StatusThreadHandler.CheckForException()
13:10:11   Error    |     at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext, Nullable`1 syncPass, String syncSessionId)
13:10:11   Error    |     at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)
13:10:11   Error    |     at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
13:10:11   Error    |     at Calamari.Azure.Deployment.Conventions.AzureWebAppConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\AzureWebAppConvention.cs:line 22
13:10:11   Error    |     at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
13:10:11   Error    |     at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
13:10:11   Error    |     Running rollback conventions...
13:10:11   Error    |     Microsoft.Web.Deployment.DeploymentException: (3/17/2016 1:10:11 PM) An error occurred when the request was processed on the remote computer. ---> Microsoft.Web.Deployment.DeploymentClientServerException: An error was encountered when processing operation 'Create Directory' on 'D:\home\site\wwwroot\..'. ---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x800700A1. ---> System.IO.IOException: The specified path is invalid.
13:10:11   Error    |     at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
13:10:11   Error    |     at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path)
13:10:11   Error    |     at Microsoft.Web.Deployment.DirPathProviderBase.CreateDirectory(String fullPath, DeploymentObject source)
13:10:11   Error    |     at Microsoft.Web.Deployment.DirPathProviderBase.Add(DeploymentObject source, Boolean whatIf)
13:10:11   Error    |     --- End of inner exception stack trace ---
13:10:11   Error    |     --- End of inner exception stack trace ---
13:10:11   Error    |     --- End of inner exception stack trace ---
13:10:11   Error    |     at Microsoft.Web.Deployment.StatusThreadHandler.CheckForException()
13:10:11   Error    |     at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext, Nullable`1 syncPass, String syncSessionId)
13:10:11   Error    |     at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)
13:10:11   Error    |     at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
13:10:11   Error    |     at Calamari.Azure.Deployment.Conventions.AzureWebAppConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\AzureWebAppConvention.cs:line 22
13:10:11   Error    |     at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
13:10:11   Error    |     at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 50
13:10:11   Error    |     at Calamari.Azure.Commands.DeployAzureWebCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Commands\DeployAzureWebCommand.cs:line 86
13:10:11   Error    |     at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
13:10:11   Fatal    |     The step failed: The remote script failed with exit code 100
13:10:11   Verbose  |     ProjectName completed

I found this http://help.octopusdeploy.com/discussions/questions/6220-how-can-i-deploy-to-azure-web-site-to-the-path-site-instead-of-sitewwwroot post but I was hoping there would be a more elegant solution to do this now.

Hi Mike,

Unfortunately there is nothing built-in to support you scenario, but you could try the suggestion to use KuduExec in this ticket.

I hope that helps!

Thank you and warm regards,
Henrik