Search code examples
azureazure-web-app-servicemsdeploy

Publish app containing virtual directory to Azure app service


I have an app that's structured like this:

app\ <-- not exposed through IIS
 -> Config\ <-- Contains config for IIS application
 -> Shared\ <-- Contains binaries for IIS application
 -> Transform\ <-- Config, etc
 -> Web\  <--- IIS application directory

I don't want to have to restructure the entire thing so that everything outside Web\ is contained within it and referenced that way. However, I can't get visual studio to publish to my app service in such a way that Web\ is the IIS application directory and everything else is published above it.

I've tried a lot of different ways to set the Virtual Applications and Directories for the app service but none of them are working. How can I publish to a parent of the IIS application directory?


Solution

  • I ended up with two applications: one for app/ and one for app/Web/. Publishing to app/ is now working even though I could swear it was producing unintended consequences when I first tried it. Here is my msdeploy command, a good bit of which came from David Ebbo's blog:

    C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe -verb:sync -source:contentPath="$projectDir\Package" -dest:contentPath="Default Web Site",computerName="https://myAppName.scm.azurewebsites.net:443/msdeploy.axd?site=Default Web Site",userName=$user,password=$password.Trim(),AuthType=Basic