Upgrading Service Fabric applications

To perform the upgrade, Service Fabric performs a comparison of the old and the new application manifest. The application is upgraded only if there is a change in version number. The following flowchart explains the application upgrade process:

Application upgrade process

An already deployed Service Fabric can be upgraded to a newer version using PowerShell cmdlets. Following are the steps to be performed to upgrade a Service Fabric application:

  1. Package the application: The first step for upgrading is to package the newer version of the application. This can be done using Visual Studio.
  2. Upload package: Once packaged, the package needs to be uploaded into the Service Fabric image store. The following PowerShell cmdlet can be used to perform this operation:
      Copy-ServiceFabricApplicationPackage <Package folder path> 
-ImageStoreConnectionString file:<Local image store path>
-ApplicationPackagePathInImageStore <Application package name>

The parameter ApplicationPackagePathInImageStore informs the Service Fabric orchestrator about the location of the application package.

  1. Register the updated application: The uploaded package now should be registered for Service Fabric to use it. This can be done using the Register-ServiceFabricApplicationType cmdlet:
      Register-ServiceFabricApplicationType <Application name>
  1. Perform the upgrade: Upgrading the application without downtime and handling failures gracefully is a key feature of Service Fabric. This process operates on various configurations set by the user such as timeouts, health criteria, and so on Parameters like HealthCheckStableDuration, UpgradeDomainTimeout, and UpgradeTimeout need to be set for Service Fabric to perform the upgrade. The UpgradeFailureAction also should be set by the user so that Service Fabric knows what to do if an upgrade operation fails. Once these parameters are decided, the upgrade process can be kicked off by using the Start-ServiceFabricApplicationUpgrade cmdlet:
      Start-ServiceFabricApplicationUpgrade -ApplicationName 
fabric:/<Application name>-ApplicationTypeVersion <New app
version>
-HealthCheckStableDurationSec <Duration>
-UpgradeDomainTimeoutSec <Timeout>
-UpgradeTimeout <Timeout> -FailureAction <Action> -Monitored

The application name in the preceding command must match the one specified for the already deployed application, as Service Fabric uses this name to identify the application.

  1. Check upgrade: Service Fabric Explorer can be used to monitor the upgrade process for applications. The Get-ServiceFabricApplicationUpgrade cmdlet can also be used for this purpose:
        Get-ServiceFabricApplicationUpgrade fabric:/<Application
Name>
..................Content has been hidden....................

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