Deploying Service Fabric applications

After an application is built, it needs to be packaged for it to be deployed on a Service Fabric cluster. This task can be easily achieved using Visual Studio. The packaged application should be uploaded and registered before the Service Fabric cluster manager can instantiate the application. Following are the steps involved:

  1. Uploading an application: This task is required as it places the application packages in a shared location from which the Service Fabric components can access it. An application package typically contains the following:
    • Application manifests
    • Service manifests
    • Code
    • Configuration
    • Data packages

The following cmdlet can be used to upload an application package for deployment:

      Copy-ServiceFabricApplicationPackage <Source package folder> 
-ImageStoreConnectionString file:<Local image store path>
-ApplicationPackagePathInImageStore <Application package name>

  1. Registering the application package: Package registration makes the application type and version declared in the manifest available for use. Service Fabric reads the registered package, verifies it, and moves the package to an internal store for further processing. Application packages can be registered using the following cmdlet:
      Register-ServiceFabricApplicationType <Application name>

All registered packages in the cluster can be listed using the following cmdlet:

      Get-ServiceFabricApplicationType
  1. Instantiating the application: The New-ServiceFabricApplication cmdlet can be used to instantiate a specific version of a registered application type. The application name should be declared at the deploy time using the following scheme:
      Fabric:<Application name>
  • The following usage of the preceding cmdlet can be used to create a new application instance:
            New-ServiceFabricApplication fabric:/<Application name> 
<Application type> <Application version>
  • The following cmdlet can be used to list all the application instances which are successfully created in a cluster:
            Get-ServiceFabricApplication
  • The preceding command can be used along with the Get-ServiceFabricService cmdlet to list the services running under each application instance. Following is the usage:
             Get-ServiceFabricApplication | Get-ServiceFabricService  
..................Content has been hidden....................

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