Updating service manifest

Service manifest file stores the configuration for service deployment. This file needs to be updated to provide a name to the service, to specify the command used to launch the application, and to specify and setup or configure scripts which need to be executed. Following is an example of a service manifest file:

<?xml version="1.0" encoding="utf-8"?> 
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="NodeApp" Version="1.0.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="NodeApp" UseImplicitHost="true"/>
</ServiceTypes>
<CodePackage Name="code" Version="1.0.0.0">
<SetupEntryPoint>
<ExeHost>
<Program>scriptslaunchConfig.cmd</Program>
</ExeHost>
</SetupEntryPoint>
<EntryPoint>
<ExeHost>
<Program>node.exe</Program>
<Arguments>bin/www</Arguments>
<WorkingFolder>CodePackage</WorkingFolder>
</ExeHost>
</EntryPoint>
</CodePackage>
<Resources>
<Endpoints>
<Endpoint Name="NodeAppTypeEndpoint" Protocol="http" Port="3000" Type="Input" />
</Endpoints>
</Resources>
</ServiceManifest>

To break this down further, let's go through every section in the service manifest:

<ServiceTypes> 
<StatelessServiceType ServiceTypeName="NodeApp" UseImplicitHost="true" />
</ServiceTypes>

ServiceTypeName is a custom parameter which can be assigned to the deployed service. This value will be later used in the application manifest file. It is important to set the UseImplicitHost as true as this specifies the service as self-contained:

<CodePackage Name="Code" Version="1.0.0.0"> 

CodePackage element specifies the location of the folder holding the code and the version of the application packaged:

<SetupEntryPoint> 
<ExeHost>
<Program>scriptslaunchConfig.cmd</Program>
</ExeHost>
</SetupEntryPoint>

SetupEntryPoint is an optional element used to specify the executable of batch files which should be executed before the service code is launched. This can be ignored as there are no startup scripts for the application. There can only be one SetupEntryPoint for a package:

<EntryPoint> 
<ExeHost>
<Program>node.exe</Program>
<Arguments>bin/www</Arguments>
<WorkingFolder>CodeBase</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>
</ExeHost>
</EntryPoint>

The EntryPoint element specifies the details about application launch. The Program element specifies the name of the executable to be launched, Arguments element specifies the parameters to be passed in as arguments to the executable and the WorkingFolder specifies the working directory. ConsoleRedirection can be used to setup logging. This element helps redirect console output to a working directory:

<Endpoints> 
<Endpoint Name="NodeAppTypeEndpoint" Protocol="http" Port="3000" Type="Input" />
</Endpoints>

The Endpoints element specifies the endpoint this application can listen on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.12.230