Copy-​Service​Fabric​Application​Package

Copies a Service Fabric application package to the image store.

Syntax

Copy-ServiceFabricApplicationPackage
    [-ApplicationPackagePath] <String>
    [[-ImageStoreConnectionString] <String>]
    [[-ApplicationPackagePathInImageStore] <String>]
    [-ApplicationPackageCopyPath <String>]
    [-CertStoreLocation <StoreLocation>]
    [-CompressPackage]
    [-GenerateChecksums]
    [-ShowProgress]
    [-ShowProgressIntervalMilliseconds <Int32>]
    [-SkipCopy]
    [-TimeoutSec <Int32>]
    [-UncompressPackage]
    [<CommonParameters>]

Description

The Copy-ServiceFabricApplicationPackage cmdlet copies a Service Fabric application package to the image store. This cmdlet can also be used for compressing and uncompressing a Service Fabric application package without actually copying it to the image store.

After copying the application package, use the Register-ServiceFabricApplicationType cmdlet to register the application type.

After registering the application package, use the Remove-ServiceFabricApplicationPackage cmdlet to remove the application package.

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: Copy an application package

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\ApplicationPackages\PersistentToDoListService" -ImageStoreConnectionString "fabric:ImageStore"

This command copies the application package to the cluster's image store. When ApplicationPackagePathInImageStore parameter is not specified, it is defaulted to the folder name. In this example, ApplicationPackagePathInImageStore will default to PersistentToDoListService

Example 2: Copy an application package to a specific directory in the image store

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\ApplicationPackages\PersistentToDoListService" -ImageStoreConnectionString "fabric:ImageStore" -ApplicationPackagePathInImageStore "PersistentToDoListService_v2"

This command copies the application package to PersistentToDoListService_v2 directory in the cluster's image store.

Example 3: Copy a compressed application package to a specific directory in the image store

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\ApplicationPackages\PersistentToDoListService" -ImageStoreConnectionString "fabric:ImageStore" -ApplicationPackagePathInImageStore "PersistentToDoListService_v2" -CompressPackage

This command compresses all sub-directories under the service directory and then copies the application package to PersistentToDoListService_v2 directory in the cluster's image store.

Example 4: Show progress bar for the copy operation on PowerShell window

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\ApplicationPackages\PersistentToDoListService" -ImageStoreConnectionString "fabric:ImageStore" -ApplicationPackagePathInImageStore "PersistentToDoListService_v2" -ShowProgress -ShowProgressIntervalMilliseconds 500

This command shows a progress bar on the PowerShell window while copying the application package to PersistentToDoListService_v2 directory in the cluster's image store. The progress bar is refreshing every 500ms.

Example 5: Compress the application package on the local machine without copying to image store

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\ApplicationPackages\PersistentToDoListService" -CompressPackage -SkipCopy

This command compresses all sub-directories under the service directory without actually copying the application package to the cluster's image store.

Example 6: Uncompress the application package on the local machine without copying to image store

PS C:\> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\ApplicationPackages\PersistentToDoListService" -UncompressPackage -SkipCopy

This command uncompresses all sub-directories under the service directory without actually copying the application package to the cluster's image store.

Required Parameters

-ApplicationPackagePath

Specifies the relative path of an application package. The cmdlet copies the package from the path that you specify.

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

Optional Parameters

-ApplicationPackageCopyPath

{{Fill ApplicationPackageCopyPath Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplicationPackagePathInImageStore

Specifies the relative path in the image store where the application package should be copied.

Type:String
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertStoreLocation

{{Fill CertStoreLocation Description}}

Type:StoreLocation
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CompressPackage

Specifies to compresses all sub-directories under the service directory (code/config/data packages) in the application package. If SkipCopy is not specified, the folders is compressed before copying the application package to the image store.

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

{{Fill GenerateChecksums Description}}

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

Specifies the connection string for the Service Fabric image store. Read more about the image store connection string.

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ShowProgress

Specifies to shows a progress bar in the PowerShell window while copying the application package to the image store.

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

Specifies the frequency at which the progress bar is refreshed in the PowerShell window while copying the application package to the image store.

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

Specifies to skip copying the application package to the image store. This should be used when an application package needs to be compressed or uncompressed without copying the application package to the image store.

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

Specifies the timeout in seconds, for the operation. By default, the maximum timeout value is limited to 1800 seconds.

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

Specifies to uncompress all sub-directories under the service directory (code/config/data packages) in the application package. This can be used with the SkipCopy parameter to uncompress the application package locally without actually copying the application package to the image store.

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

Inputs

None

You cannot pipe input to this cmdlet.

Outputs

System.Object

This cmdlet returns a message that includes the status of the copy operation.