The process of creating continuous integration process in azure is well described here http://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/.
Unfortunately there are several issues you might encounter that are not covered in the above document.
One of them is related to the error message below:`C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets (632): The role '*WorkerRole' was not found in the service definition. Parameter name: roleName`
The simple solution is to add
/m:1 argument to the "MSBuild Arguments" for the Build definition. So your full MSBuild Arguments field will look something like this:
Explanation of why it works
In our solution we have several worker roles and web roles as part of the solution. With Azure SDK 2.0 and TFS. Build all files including ServiceDefinition.csdef are copied to the single output directory. By default TFS Build includes
/m flag which uses multiple threads (= number of cores) to build a solution. They can result in projects built in slightly different order and overwriting of the ServiceDefinition file, setting it to use a single thread resolve this issue.
Hope this helps somebody, as I spent a day trying to troubleshoot this.