Azure Service Fabric Manifests

In general, a new Service Fabric solution (from the Azure Service Fabric SDK project templates) will create an Application Project and a Service Project.

The Application Project contains the ApplicationManifest file in the ApplicationPackageRoot folder, and is named ApplicationManifest.xml.

Outline from Solution Explorer for a Service Fabric Application project

The model of a Service Fabric Application is that the Application may contain one or more Services.

The Service Project (or Projects) contain the ServiceManifest files in their PackageRoot folder. These files are named ServiceManifest.xml.

Outline from Solution Explorer for a Service Fabric Service project


The basic template has a fairly simple structure:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd=""
    <Parameter Name="⟬service-name⟭_InstanceCount"
               DefaultValue="-1" />
  <!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. --> <ServiceManifestImport> <ServiceManifestRef ServiceManifestName="⟬service-name⟭Pkg" ServiceManifestVersion="1.0.0" /> <ConfigOverrides /> </ServiceManifestImport> <DefaultServices> <!-- The section below creates instances of service types, when an instance of this application type is created. You can also create one or more instances of service type using the ServiceFabric PowerShell module. The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. --> <Service Name="⟬service-name⟭"> <StatelessService ServiceTypeName="⟬service-name⟭Type" InstanceCount="[⟬service-name⟭_InstanceCount]"> <SingletonPartition /> </StatelessService> </Service> </DefaultServices> </ApplicationManifest>


  • application-name⟭ ::= the name you gave the New Project wizard for the name of the application
  • service-name⟭ ::= the name you gave the New Project wizard for the name of the Service (when you select the type of service)

So far, the only configuration setting I have changed in this file is at


I’ve changed the value of that attribute to −1 in order to deploy the service to all the available nodes.

As I collect more services in an application, I’ll add entries to the ServiceManifestImport element and probably to the DefaultServices element.


The basic template for the ServiceManifest, like the ApplicationManifest, has a simple structure.

<?xml version="1.0"
<ServiceManifest Name="⟬service-name⟭Pkg"
    <!-- This is the name of your ServiceType. 
         This name must match the string used in RegisterServiceType call in Program.cs. -->
    <StatelessServiceType ServiceTypeName="⟬service-name⟭Type" />
  <!-- Code package is your service executable. -->
  <CodePackage Name="Code"
  <!-- Config package is the contents of the Config directoy under PackageRoot that contains an 
       independently-updateable and versioned set of custom configuration settings for your service. -->
  <ConfigPackage Name="Config"
                 Version="1.0.0" />
      <!-- This endpoint is used by the communication listener to obtain the port on which to 
           listen. Please note that if your service is partitioned, this port is shared with 
           replicas of different partitions that are placed in your code. -->
      <Endpoint Name="ServiceEndpoint" />


  • service-name⟭ ::= the name you gave the New Project wizard for the name of the Service (when you select the type of service)

So far, I have not made any changes to this file.

The comments in both files are helpful.


Alan McBee

comments powered by Disqus