Reputation: 6506
I've got an Azure WebRole poject and I can successfully publish it using Visual Studio's built in wizard, But we want to automate the process.
How can I publish the Azure WebRole using MSbuild or any other command-line tool?
Upvotes: 8
Views: 4220
Reputation: 11989
This question is pretty old, but I recently cleaned up a simple one-line command tool to do this, which you can download into your solution via NuGet.
Basically:
.\SrirachaTools\Runners\Azure\sriracha.run.exe
--taskBinary=Sriracha.DeployTask.Azure.dll --taskName=DeployCloudServiceTask
--configFile=.\MyDeployCloudService.json --outputFormat text
More info here: http://mooneyblog.mmdbsolutions.com/index.php/2015/03/21/windows-azure-6-deploying-via-sriracha-command-line-tools/
NuGet package here: http://www.nuget.org/packages/Sriracha.DeployTask.Azure/
And the code is here: https://github.com/mmooney/Sriracha2/
Upvotes: 2
Reputation: 7483
Here're two good articles about it:
http://blog.slalom.com/2011/08/19/building-and-deploying-windows-azure-projects-using-msbuild-and-tfs-2010/ - this one is very good as it covers having multiply service definitions in the same Azure ccproj, using custom WindowsAzure.targets file and other useful hacks.
http://blogs.msdn.com/b/tomholl/archive/2011/12/06/automated-build-and-deployment-with-windows-azure-sdk-1-6.aspx - this one is good also, but uses PowerShell cmdlets, which is not bad at all, but requires one more component to install on build machine, which is something you want to avoid sometimes.
Upvotes: 2
Reputation: 1516
You might also want to create a console application. I posted sample code there: http://code.msdn.microsoft.com/Automating-a-deployment-ecd7bf3b
Upvotes: 2