Share via


Test-ServiceFabricApplicationPackage

Validates a Service Fabric application package.

Syntax

SFApplicationPackage (Default)

Test-ServiceFabricApplicationPackage
    [-ApplicationPackagePath] <String>
    [-ApplicationParameter <Hashtable>]
    [-ImageStoreConnectionString <String>]
    [<CommonParameters>]

Compose

Test-ServiceFabricApplicationPackage
    [-ComposeFilePath] <String>
    [-RegistryUserName <String>]
    [-RegistryPassword <String>]
    [-PasswordEncrypted]
    [-ImageStoreConnectionString <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.

Parameters

-ApplicationPackagePath

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

Parameter properties

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

Parameter sets

SFApplicationPackage
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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.

Parameter properties

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

Parameter sets

SFApplicationPackage
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ComposeFilePath

Specifies the file path to a compose file which describes the Service Fabric compose deployment.

Parameter properties

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

Parameter sets

Compose
Position:0
Mandatory:True
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.

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.

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

-PasswordEncrypted

Indicates if RepositoryPassword is encrypted by Invoke-ServiceFabricEncryptText.

Parameter properties

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

Parameter sets

Compose
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RegistryPassword

{{Fill RegistryPassword Description}}

Parameter properties

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

Parameter sets

Compose
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RegistryUserName

{{Fill RegistryUserName Description}}

Parameter properties

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

Parameter sets

Compose
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