Register-​Service​Fabric​Application​Type

Registers a Service Fabric application type.

Syntax

Register-ServiceFabricApplicationType
        [-ApplicationPathInImageStore] <String>
        [-Async]
        [-TimeoutSec <Int32>]
        [<CommonParameters>]

Description

The Register-ServiceFabricApplicationType cmdlet registers a Service Fabric application type. The application package must exist in the image store, which can be done with Copy-ServiceFabricApplicationPackage.

After you register an application type, you can use the New-ServiceFabricApplication cmdlet to create an application instance. Use the Start-ServiceFabricApplicationUpgrade cmdlet to upgrade an existing application.

When the application type with the specified version is not needed anymore, you can unregister it using Unregister-ServiceFabricApplicationType cmdlet.

To manage Service Fabric clusters, start Windows PowerShell by using the Run as administrator option. Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Register an application type

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "c:\work\PersistentToDoListService" -ImageStoreConnectionString "file:C:\SfDevCluster\Data\ImageStoreShare" -ApplicationPackagePathInImageStore "PersistentToDoListService"
PS C:\> Register-ServiceFabricApplicationType -ApplicationPathInImageStore "PersistentToDoListService"

Copy-ServiceFabricApplicationPackage copies the application package found in the "c:\work\PersistentToDoListService" folder to the image store. The package is copied at the relative path "PersistentToDoListService" in image store.

Register-ServiceFabricApplicationType command registers the application type found in the relative path "PersistentToDoListService".

Example 2: Register an application type async

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "c:\work\PersistentToDoListService" -ImageStoreConnectionString "fabric:ImageStore" -ApplicationPackagePathInImageStore "PersistentToDoListService" -CompressPackage
PS C:\> Register-ServiceFabricApplicationType -ApplicationPathInImageStore "PersistentToDoListService" -Async
PS C:\> Get-ServiceFabricApplicationType

Copy-ServiceFabricApplicationPackage copies the application package found in the "c:\work\PersistentToDoListService" folder to the image store. The application package is copied at the relative path "PersistentToDoListService" in image store. The cmdlet uses compression to reduce the package size.

Register-ServiceFabricApplicationType command registers the application type found in the relative path "PersistentToDoListService". Register is done async, and it returns as soon as the command is accepted by the cluster.

Get-ServiceFabricApplicationType gets the application types registered in the cluster. Each application type includes the registration status. The cmdlet can be used to determine when the registration completes.

Example 3: Register an application type for a large application package

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "c:\work\PersistentToDoListService" -ImageStoreConnectionString "fabric:ImageStore" -ApplicationPackagePathInImageStore "PersistentToDoListService" -CompressPackage -TimeoutSec 2700
PS C:\> Register-ServiceFabricApplicationType -ApplicationPathInImageStore "PersistentToDoListService" -TimeoutSec 2700

Copy-ServiceFabricApplicationPackage copies the application package found in the "c:\work\PersistentToDoListService" folder to the image store, at the "PersistentToDoListService" image store relative location. Since the initial package is very large, the command compress it and includes a higher timeout to allow enough time for copy.

Register-ServiceFabricApplicationType command registers the application type found in the relative path "PersistentToDoListService". The command includes a higher timeout to allow work to finish even if the application package is large.

Required Parameters

-ApplicationPathInImageStore

Specifies the relative path of the application type package in the image store. This path was specified by the Copy-ServiceFabricApplicationPackage cmdlet when the application package was copied to the image store.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Async

The command returns as soon as the registration request has been accepted by the cluster. The Get-ServiceFabricApplicationType command can be used to query the status of the registration request. Using this switch avoids having to provide large -TimeoutSec values when registering large application packages.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object