We want to ingest bunch of external Service Fabric Services, which are packaged into Universal Packages.
To download these services, I had to use vsts cli
- once they are downloaded I can see the ServiceManifest.xml
and the Code / Config
folders in the location that I've downloaded. I now want to add them as some kind of external services to my manifest.
How should I modify the ApplicationManifest.xml
so these services are added?
Inside the <ServiceManifestImport>
node in ApplicationManifest.xml
you should add references to each of the service you would like to have in your application.
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="ServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
</ServiceManifestImport>
Here is two important things to understand:
While in general one ServiceManifest.xml
contains definition of single service from the design standpoint ServiceManifest.xml
describes a so-called service package. This service package is the thing referenced inside ApplicationManifest.xml
.
The value of ServiceManifestName
attribute is the name of ServiceManifest.xml
. ServiceManifest.xml
name is defined inside it using ServiceManifest/@Name
attribute. At the same time ServiceManifestName
attribute defines name of directory relative to location of ApplicationManifest.xml
where ServiceManifest.xml
, Code
, Config
and other folders are located.
Here is a quick example
Imagine you assemble a package in C:\MyPackage
directory and you want to use external service which has Service1
name in ServiceManifest.xml
.
ApplicationManifest.xml
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Service1" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
</ServiceManifestImport>
ApplicationManifest.xml
to C:\MyPackage
directory.C:\MyPackage\Service1
directory and copy ServiceManifest.xml
, Code
and etc. to C:\MyPackage\Service1
.Test-ServiceFabricApplicationPackage C:\MyPackage
Hope this helps.