0
votes

I have created in my VS2015 an azure cloud service with a worker role. These are 2 projects.

I want to know how can I pack and then publish this cloud service with a tool/cli?

When I google for 'deploy azure cloud service' I get only result saying to do it within Visual Studio or Visual Studio Team System.

This is NOT what I want!

1
Almost everything in azure has a powershell commandlet to do the configuration from the command line. I don't know specifically about cloud services, but it would surprise me if that wasn't in there.Erik Funkenbusch
Did you tried googling "deploy azure cloud service powershell" ?CSharpRocks
Of course I checked my powershell ISE, searched in the modules/cmdlets for 'cloud' and got 4 not interesting results.Pascal
When I read this: kenneth-truyers.net/2014/02/06/… - I can just shake my head... seems someone did the job for Microsoft...Pascal
Have you installed the Azure SDK? Powershell doesn't contain stuff for azure by default.Erik Funkenbusch

1 Answers

0
votes

We can use the cspack command line tool to package a cloud service. If the application only contains worker role, you could refer to the following command.

cspack D:\xxx\xxx\ServiceDefinition.csdef /role:WorkerRole1;D:\xxx\WorkerRole1\bin;D:\xxx\WorkerRole1\bin\Debug\WorkerRole1.dll

And you could refer to the PublishCloudService.ps1 script template in this article.

cspack could not be found in the powershell commandlets

The cspack could run in Windows PowerShell on my side. I add C:\Program Files\Microsoft SDKs\Azure\.NET SDK\[sdk-version]\bin in Path system environment variables, and I could run the following command to package a cloud service.

enter image description here