title: Using MSBuild and CSPack task to package Azure roles
body: <p>I am working on a build script for an Azure web role project. The script will run on a build server, so using VS is a non-starter.</p>
  
  <p>I can build the project using MSBuild and use <a href="http://code.msdn.microsoft.com/azurecmdlets">CmdLets for Azure</a> to handle the deployment (via PowerShell). The part that is missing is the creation of the cloud package. I can use the CSPack.exe tool that is included in the SDK, but I would like to use MSBuild tasks if possible, as that way I can leverage the build configuration options and integrate the creation of the package with the rest of the process.</p>
  
  <p>I've dug around in the Azure web deployment project, but I can't find any references to the CSPack task. There might be some VS magic happening here, unless I am missing the file that references the CSPack/Azure tasks. The assembly that I am looking at is Microsoft.ServiceHosting.Tools.MSBuildTasks.dll - reflector tells me that the CSPack Task is in there.</p>
  
  <p>Has anyone successfully used the CSPack MSBuild task? If so, any pointers as to how to use it would be very helpful!</p>
  
  <p>If I am barking up the completely wrong tree, please let me know!</p>
  
  <p>Thanks,
  Erick</p>