Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish Azure Project from Command Line

Tags:

msbuild

azure

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?

like image 252
sternr Avatar asked Dec 19 '11 18:12

sternr


People also ask

How do I publish my Azure project?

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.

How do I publish a Visual Studio solution from the command line?

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.

How do I deploy Azure code?

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.


2 Answers

You might also want to create a console application. I posted sample code there: http://code.msdn.microsoft.com/Automating-a-deployment-ecd7bf3b

like image 142
benjguin Avatar answered Sep 23 '22 02:09

benjguin


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.

like image 41
Nikita R. Avatar answered Sep 21 '22 02:09

Nikita R.