OPC Archive Layout
Updated: September 30, 2014
Open Packaging Conventions (OPC) is a portable container technology that defines a structured way to store application data together with related resources. A package is a ZIP archive. A package contains two basic elements: parts and relationships. Parts are data streams that represent the content being packaged, such as binary or text files. A part in a package is defined by a URI and a MIME content type. Relationships define associations between the package, parts, and external resources. For more information about OPC, see Open Packaging Conventions and part 2 of the standard ECMA-376.
The new package format for Windows Azure contains the following elements:
_rels directory - Contains the package relationships in the .rels file.
[Content_Types].xml file - Specifies the MIME type of each part in the package.
ServiceDefinition directory - Contains the .csdef file of the cloud service.
LocalContent directory - Contains all of the other files included in the package. These files can be text or binary.
NamedStreams directory - Contains support data.
XML manifest of the package, package.xml - Contains all of the meta information about the package and the individual parts in the package. For more information, see XML Manifest File Format.
|The ServiceDefinition, LocalContent, and NamedStreams directories are specific to the new package format for Windows Azure. The _rels directory and [Content_Types].xml file are required by the OPC specification.|
The new package format has a single, mandatory OPC package relationship. The relationship is the following URI:
The OPC package relationship encodes versioning information. The relationship points to a package part that is an XML manifest specification. By convention, the XML manifest file is named package.xml. However, the XML manifest can be any file in the archive as long as the relationship points to the XML manifest file and the XML manifest file conforms to the schema. See XML Manifest File Format for more information. If the schema of the XML manifest changes, a new package relationship URI is defined for the new format. Using this approach, it is technically possible to have one OPC archive contain several different manifests, each of which targets a specific version based on the relationship. However, it is an error for a package to have more than one part with a specific relationship URI.
The OPC format allows for the encoding of MIME content type information. However, the existing package format does not take advantage of this information. Systems can ignore the MIME content types when they read or generate packages. Because of this, you should use the default content type application/octet-stream.
ConceptsWindows Azure Package Format