Copy-ServiceFabricApplicationPackage

Copies a Service Fabric application package to the image store.

Syntax

Copy-ServiceFabricApplicationPackage
    [-ApplicationPackagePath] <String>
    [[-ImageStoreConnectionString] <String>]
    [[-ApplicationPackagePathInImageStore] <String>]
    [-ApplicationPackageCopyPath <String>]
    [-ShowProgress]
    [-ShowProgressIntervalMilliseconds <Int32>]
    [-CompressPackage]
    [-UncompressPackage]
    [-SkipCopy]
    [-GenerateChecksums]
    [-CertStoreLocation <StoreLocation>]
    [-TimeoutSec <Int32>]
    [<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.

Parameters

-ApplicationPackageCopyPath

Specifies a destination at which to create a local copy of the application package for uploading. The local copy is made before the GenerateChecksums and CompressPackage switches are applied, so this switch is useful if the location of the original source package is read-only.

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

-ApplicationPackagePath

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

Type:String
Position:0
Default value:None
Required:True
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:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CertStoreLocation

Specifies a certificate store location to use when computing application package checksums using the GenerateChecksums switch.

Type:StoreLocation
Accepted values:CurrentUser, LocalMachine
Position:Named
Default value:LocalMachine
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CompressPackage

Compresses all sub-directories under the application package root directory (code/config/data packages). If SkipCopy is not specified, then the folders are compressed before copying the application package to the image store. If ApplicationPackageCopyPath is specified, then compression happens in that directory rather than the original source directory.

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

-GenerateChecksums

Pre-generates application package checksum files before uploading. This frontloads the cost of computing application package checksums so that they do not have to be computed by the cluster during Register-ServiceFabricApplicationType.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
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. This parameter is not needed if Connect-ServiceFabricCluster was executed successfully.

Type:String
Position:1
Default value:None
Required:False
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
Required:False
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:2000
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SkipCopy

Doesn't perform any uploading of the application package. 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
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UncompressPackage

Uncompresses all compressed files under the application package root directory (code/config/data packages). This can be used with the SkipCopy parameter to uncompress the application package locally without actually copying the application package to the image store. If ApplicationPackageCopyPath is specified, then uncompression happens in that directory rather than the original source directory.

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

Inputs

None

Outputs

System.Object