In my example I created a single website and associated it to my azure project as the only worker role.
In the worker role pre-build event I have placed the following for each website that needed to be packaged and transformed:
Cloud Project Pre Build Event
rmdir ..\Deploy.Cloud\Website.Mvc /S /Q
"%systemroot%\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" "$(ProjectDir)..\Website.Mvc\Website.Mvc.csproj" "/p:Platform=AnyCPU;PackageAsSingleFile=False;Configuration=$(ConfigurationName);DesktopBuildPackageLocation=..\Package\Website.Mvc;PackageAsSingleFile=False;IntermediateOutputPath=..\Deploy.Cloud\Website.Mvc\\" /t:Package
*You must remove the intermediate location before it creates the package otherwise debug/release configurations will not differ
*Note the extra slash at the end yes that is intentional if you do not add it you will get some interesting error messages about properties with no value
ServiceDefinition.csdef
What's going on here
ServiceDefinition.csdef
<Site name="Website.Mvc" physicalDirectory="Website.Mvc\Package\PackageTmp">
What's going on here
Every time the cloud project builds it will copy and package the website in the cloud project's project root folder as the website name. Next step is to update the ServiceDefinition.csdef use the intermediate path location for the physicalDirectory. Why? because the package directory contains all of the assets to be deployed as a web deployment project which is not needed when deploying using a web role.
References