Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

Use CSPack to create a package in the new format

Updated: December 4, 2013

To deploy an application as a cloud service in Windows Azure, you must first package the application in the appropriate format. You can use the CSPack Command-Line Tool (CSPack) to create the package file. CSPack uses the contents of the service definition file and service configuration file to define the contents of the package. You can modify the service definition file and service configuration file by using a text editor or by using Visual Studio. For more information, see CSPack Command-Line Tool.

CSPack generates an application package file (.cspkg) that you can upload to Windows Azure by using the Windows Azure Management Portal. By default, the package is named <ServiceDefinitionFileName>.cspkg, but you can specify a different name by using the /out option of CSPack. By default, the CSPack tool is installed to C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\<sdk version>\bin .

Beginning in version 1.7 of the Windows Azure SDK, the CSPack tool can create a package file in OPC format by use of the /useCtpPackageFormat option. For more information about the new package format, see Windows Azure Package Format.

To package an application in the new format

  1. Click Start, point to All Programs, and then click Windows Azure. Select Windows Azure SDK for .NET, and then specify the SDK version.

  2. Right-click Windows Azure Command Prompt.

  3. In the Windows Azure SDK Command Prompt window, change the directory to the location of your application files.

  4. The following example creates an application package that contains the information for a web role. The command specifies the service definition file to use, the directory where binary files can be found, and the name of the package file. The /useCtpPackageFormat option specifies that the package be created in the new package format.

    cspack <DirectoryName>\<ServiceDefinition>
       /role:<RoleName>;<RoleBinariesDirectory>
       /sites:<RoleName>;<VirtualPath>;<PhysicalPath>
       /rolePropertiesFile:<RoleName>;<RolePropertyFile>
       /out:<OutputFileName>
       /useCtpPackageFormat
    
    

Example

The following example creates a package of the HelloWorld web application in the new package format.

C:\Samples\HelloWorld\C#>cspack HelloWorld\ServiceDefinition.csdef 
/role:HelloWorld_WebRole;HelloWorld_WebRole 
/sites:HelloWorld_WebRole;Web;C:\Samples\HelloWorld\C#\HelloWorld_WebRole 
/rolePropertiesFile:HelloWorld_WebRole;.\HelloWorldProperties.txt 
/out:C:\Samples\HelloWorld\C#\HelloWorldnew.cspkg
/useCtpPackageFormat

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.