bobo2000
bobo2000

Reputation: 1877

how to create a cloud service package (.cspkg) and cloud service configuration file (.cscfg)

I have created a web role locally, but I am struggling to do this with the windows azure sdk, the manuals dont seem to give clear instructions on how?

Thanks

Upvotes: 22

Views: 25239

Answers (5)

dqm
dqm

Reputation: 1350

You have two options with Azure:

Build your package and upload it through the Azure portal https://manage.windowsazure.com/

  1. In your Cloud project in Visual Studio right click and select "Package".
  2. Select the service configuration and build configuration (Release, Debug) you want to package. Then hit on Package. This will build all the necessary projects for your cloud solution. Once finished, it will popup a window with 2 files: a cspkg and a cscfg. The cspkg can be opened with any zip software by the way.
  3. Go to Azure portal. Select "Cloud Services". Select your cloud service name. Click on "UPLOAD A NEW PRODUCTION DEPLOYMENT". Select your cspkg and cscfg files form step 2. Give a name to your deployment.

You're done.

Publish from Visual Studio. To save the hustle right click on your Cloud project and select "Publish". Apply the necessary settings (Cloud service -this will populate automatically-, Environment, Release...as in the previous way. Make sure you go to Advanced settings to select the correct storage account if you got multiple. Hit Next, and the Publish. Visual Studio will do all the hard work for you.

Upvotes: 7

Jorn.Beyers
Jorn.Beyers

Reputation: 2054

In Visual Studio Team Services you can produce the package as follows:enter image description here The service configuration file is called "ServiceConfiguration.Cloud.cscfg" in this example. Ofcourse you can always use variables like $(BuildConfiguration). As platform I needed to use "anycpu" without a space, I was not able to get it working by using "any cpu".

Upvotes: 2

vezenkov
vezenkov

Reputation: 4155

To create the .cspkg and .cscfg via MSBuild arguments:

/t:Publish /p:TargetProfile=Local /p:AutomatedBuild=True

or

/p:DeployOnBuild=true /p:TargetProfile=Local /p:AutomatedBuild=True

Remember to replace the TargetProfile with your actual desired profile. This will automatically pick up the right ServiceDefinition.profile.csdef file.

Upvotes: 8

david van brink
david van brink

Reputation: 3642

Publishing from the GUIs (Azure Portal and Visual Studio right-click "Publish...") is fine to get started.

Eventually (sooner better than later) you'll want a reproducible scriptable one-button maker.

From within a Powershell script, the command Publish-AzureServiceProject is used to build the .cspkg and upload it. (I hesitate to say more; you'll get better results by scrutinizing their documentation, alas!)

Upvotes: 4

jfabrizio
jfabrizio

Reputation: 770

In Visual Studio, go in the Solution explorer panel, right-click on your Azure project and click on Package function. A process will generate the cspkg and cscfg files.

Upvotes: 18

Related Questions