2
votes

I have a simple project structure in my Git repository.

[repo]
  - api  (Contains a .NET WebApi application)
  - client
    - dist  (Contains a static html/js website using AngularJS)

I set up continuous deployment from Bitbucket for the api directory to an Azure Website without any glitches. I set up an App Setting named project and set the value to api/ProjectName.csproj and it works great.

I created a separate Azure website and tried to set up continuous deployment the same way for the static website, but it doesn't work. I created an App Setting named project with the value client/dist.

When it attempts to deploy, I get the following error message in the error log.

Unable to determine which solution file to build. C:\DWASFiles\Sites\flighty\VirtualDirectory0\site\repository\MyProject.sln, C:\DWASFiles\Sites\flighty\VirtualDirectory0\site\repository\client\components\moment-datepicker\MomentDatepicker.sln.

1

1 Answers

3
votes

This scenario is a little trickier now than it should be, but here is a way you should be able to get this working.

You'll need to generate a custom deployment script. Call it as follows:

azure site deploymentscript --basic -p client\dist

This will generate both a .deployment file and a deploy.cmd file. Don't commit the .deployment file as it will mess up your WebAPI scenario. Instead, in your static site:

  • Rename deploy.cmd to DeployStaticSite.cmd (this is optional, just to be clear what it does). Commit this file.
  • In the Azure portal app settings, set command to DeployStaticSite.cmd. Get rid of your project setting.