projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 654 forks source link

Using Kudu to change virtual directory physical path for an Azure Website #1548

Closed davideweaver closed 7 years ago

davideweaver commented 9 years ago

I'm trying to change the physical path of my webroot to a folder under "wwwroot". Using Kudu and deploy.cmd, I am launching a powershell script and using Microsoft.Web.Administration.ServerManager to do it, but I get a permission error when I do CommitChanges(). Can I launch the powershell script under elevated permissions or is there a better way to do what I want?

davidebbo commented 9 years ago

If this is on Azure Web App, you can change the IIS mapping in the Azure Portal, at the bottom of the configuration section.

image

davideweaver commented 9 years ago

That does work, however I'd really like to be able to make the modification from within the deployment script. Is there a way to run the powershell script using elevated privileges?

davidebbo commented 9 years ago

No way to do this using PowerShell. However, you could do it using an xdt transform. e.g see sample here.

koistya commented 7 years ago

@davidebbo is there an example on how to deploy two Node.js apps under the same Web App in Azure with Kudu? For example, one GitHub repository should go to www.example.com, and another GitHub repository to www.example.com/api/ both of which are somewhat independent Node.js apps. Ideally, these two apps must be deployed separately from each other.

In theory, it could work something like this - one project is pushed to the master branch in Azure, and another one to the api branch. Each commit in Azure triggers the corresponding deployment.

UPDATE: Created a new thread for that - https://github.com/projectkudu/kudu/issues/2228

davidebbo commented 7 years ago

@koistya this is not really related to this issue, which was about setting up virtual directories. Your issue is about deploying from multiple github repos, which Kudu does not directly support.

davidebbo commented 7 years ago

Closing this one since original issue was resolved, but feel free to open new one to discuss that other topic separately.