Test-​Service​Fabric​Application​Package

Validates a Service Fabric application package.

Syntax

Test-ServiceFabricApplicationPackage
    [-ApplicationPackagePath] <String>
    [-ApplicationParameter <Hashtable>]
    [-ImageStoreConnectionString <String>]
    [<CommonParameters>]
Test-ServiceFabricApplicationPackage
    -ComposeFilePath <String>
    [-ImageStoreConnectionString <String>]
    [-PasswordEncrypted]
    [-RepositoryPassword <String>]
    [-RepositoryUserName <String>]
    [<CommonParameters>]

Description

The Test-ServiceFabricApplicationPackage cmdlet validates a Service Fabric application package to ensure it respects the Service Fabric packaging requirements. Read more about the Service Fabric application model.

If you specify the image store connection string, the package is also validated against previous versions of the application that are provisioned in the cluster. For example, the cmdlet can detect that an application package with the same version but different content was already provisioned in the image store.

After you validate a package, use the Copy-ServiceFabricApplicationPackage cmdlet to copy it to the image store.

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: Validate an application package locally, without access to the image store

PS C:\> Test-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\CalculatorApp" -ApplicationParameter @{ "StatelessServiceInstanceCount"="-1"}

This command validates the application package found in the specified path. It includes the application parameters to be verified. The cmdlet does not specify the image store connection string because the application is still in the development phase or the cluster connection is not yet known.

Example 2: Validate an application package, locally and against any previous versions in the image store

PS C:\> Test-ServiceFabricApplicationPackage -ApplicationPackagePath "C:\CalculatorApp" -ImageStoreConnectionString "file:C:\SfDevCluster\Data\ImageStoreShare"

This command validates the application package found in the specified path. It provides the image store connection string for more validation against application versions already in the image store.

Required Parameters

-ApplicationPackagePath

Specifies the path to an application package. The cmdlet checks that the application package in the path is valid.

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

{{Fill ComposeFilePath Description}}

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

Optional Parameters

-ApplicationParameter

Specifies the overrides for application parameters as a dictionary, such as @{"key1"="value1"; "key2"="value2"}. The application parameters must be defined in the application manifest. Otherwise, the validation fails pointing to the potentially misspelled application parameter name.

You need to pass in the application parameters so the cmdlet can perform the same validation as the New-ServiceFabricApplication or Start-ServiceFabricApplicationUpgrade operations. This is useful as a sanity check to ensure the application package and the application parameters are correct. If the application has parameters that are not specified, validation is skipped.

Read more about application parameters.

Type:Hashtable
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.

If you specify this parameter, the cmdlet performs additional validations against previously deployed versions currently in the store. It is recommended you specify the image store connection string, unless the application is still being developed or the cluster information is not known.

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

{{Fill PasswordEncrypted Description}}

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

{{Fill RepositoryPassword Description}}

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

{{Fill RepositoryUserName Description}}

Type:String
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 $True if the Service Fabric application package is valid and $False otherwise.