Reputation: 4071
In the application settings of an Azure Web App you can configure multiple virtual directories and applications:
I have a solution with two web application projects. One is a UI and one is a Web API project. I want my continuous integration build in Visual Studio Team Services to be able to deploy the UI to the site root, and the Web API to the webapi virtual directory.
In the old XAML-based build definitions my solution was to use publish profiles. I would then pass MSBuild arguments such that my publish profiles would be used to deploy the two apps (my approach is explained in this question/answer).
These publish profiles still work if I want to publish manually; it's as simple as having one publish profile contain <DeployIisAppPath>mysite</DeployIisAppPath>
and the other contain <DeployIisAppPath>mysite/webapi</DeployIisAppPath>
.
But using the new 2015 Team Foundation Build deploy steps is proving more difficult. What I have at the moment is this:
This works perfectly except for the webapi deployment. This step fails, complaining that:
The website mysite/webapi was not found. Please specify a valid website name.
Apparently mysite/webapi
is not how I specify the virtual directory to deploy to. But I cannot figure out how I'm supposed to specify this in a Azure Web App Deployment step. Does anybody know how to do this?
Upvotes: 2
Views: 1136
Reputation: 266
Microsoft have released a new AzureRM Web App Deployment task that allows for virtual directories.
Upvotes: 2
Reputation: 4071
In the end I realised an obvious way to achieve what I wanted in the short term. For now I've just disabled the Azure deployment steps in the build, and modified the actual build step to not publish a web package but instead use the publish profiles to deploy directly to Azure.
So the MSBuild arguments in the Visual Studio Build step now look like this:
/p:DeployOnBuild=true /p:SkipInvalidConfigurations=true /p:PublishProfile=mysiteprofile/p:Password=paswordhashfor$mysite
This seems like what I'll have to do until the Publish-AzureWebSiteProject PowerShell cmdlet allows a virtual directory to be specified.
Upvotes: 1