Share via


Copy-ServiceFabricApplicationPackage

Copies a Service Fabric application package to the image store.

Syntax

Default (Default)

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ApplicationPackagePath

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ApplicationPackagePathInImageStore

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertStoreLocation

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

Parameter properties

Type:StoreLocation
Default value:LocalMachine
Accepted values:CurrentUser, LocalMachine
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ShowProgress

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Int32
Default value:2000
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeoutSec

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object