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?
Create or open an Azure cloud service project in Visual Studio. In Solution Explorer, right-click the project, and, from the context menu, select Convert > Convert to Azure Cloud Service Project. In Solution Explorer, right-click the newly created Azure project, and, from the context menu, select Publish.
Basic command-line publishingThe default publish folder format is bin\Debug\{TARGET FRAMEWORK MONIKER}\publish\. For example, bin\Debug\netcoreapp2. 2\publish\. The dotnet publish command calls MSBuild, which invokes the Publish target.
Deploy by using Visual Studio. If you have the Visual Studio solution, right-click the web application project, and then select Publish. Deploy by using an FTP client. In the Azure portal, download the publish profile for the web app that you want to deploy your code to.
You might also want to create a console application. I posted sample code there: http://code.msdn.microsoft.com/Automating-a-deployment-ecd7bf3b
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With