Update-AzServiceFabricApplication
Update a service fabric application. This allows to update the application parameters and/or upgrade the application type version which will trigger an application upgrade. Only supports ARM deployed applications.
Syntax
ByResourceGroup (Default)
Update-AzServiceFabricApplication
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-Name] <String>
[[-ApplicationTypeVersion] <String>]
[-ApplicationParameter <Hashtable>]
[-MinimumNodeCount <Int64>]
[-MaximumNodeCount <Int64>]
[-ForceRestart]
[-UpgradeReplicaSetCheckTimeoutSec <Int32>]
[-FailureAction <FailureAction>]
[-HealthCheckRetryTimeoutSec <Int32>]
[-HealthCheckWaitDurationSec <Int32>]
[-HealthCheckStableDurationSec <Int32>]
[-UpgradeDomainTimeoutSec <Int32>]
[-UpgradeTimeoutSec <Int32>]
[-ConsiderWarningAsError]
[-DefaultServiceTypeMaxPercentUnhealthyPartitionsPerService <Int32>]
[-DefaultServiceTypeMaxPercentUnhealthyReplicasPerPartition <Int32>]
[-DefaultServiceTypeUnhealthyServicesMaxPercent <Int32>]
[-UnhealthyDeployedApplicationsMaxPercent <Int32>]
[-ServiceTypeHealthPolicyMap <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByResourceId
Update-AzServiceFabricApplication
[[-ApplicationTypeVersion] <String>]
[-ResourceId] <String>
[-ApplicationParameter <Hashtable>]
[-MinimumNodeCount <Int64>]
[-MaximumNodeCount <Int64>]
[-ForceRestart]
[-UpgradeReplicaSetCheckTimeoutSec <Int32>]
[-FailureAction <FailureAction>]
[-HealthCheckRetryTimeoutSec <Int32>]
[-HealthCheckWaitDurationSec <Int32>]
[-HealthCheckStableDurationSec <Int32>]
[-UpgradeDomainTimeoutSec <Int32>]
[-UpgradeTimeoutSec <Int32>]
[-ConsiderWarningAsError]
[-DefaultServiceTypeMaxPercentUnhealthyPartitionsPerService <Int32>]
[-DefaultServiceTypeMaxPercentUnhealthyReplicasPerPartition <Int32>]
[-DefaultServiceTypeUnhealthyServicesMaxPercent <Int32>]
[-UnhealthyDeployedApplicationsMaxPercent <Int32>]
[-ServiceTypeHealthPolicyMap <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzServiceFabricApplication
-InputObject <PSApplication>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This cmdlet can be used to update application parameters and upgrade the application type version. Updating the parameter will only change the model in ARM side, only when a new type version is used, the command will trigger an application upgrade. The type version specified should already be created in the cluster using New-AzServiceFabricApplicationTypeVersion .
Examples
Example 1
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$version = "v2"
$packageUrl = "https://sftestapp.blob.core.windows.net/sftestapp/testAppType_v2.sfpkg"
New-AzServiceFabricApplicationTypeVersion -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -Version $version -PackageUrl $packageUrl -Verbose
Update-AzServiceFabricApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationTypeVersion $version -Name $appName -ApplicationParameter @{key0="value0";key1=$null;key2="value2"}
This example will start an application upgrade to update the type version to "v2" which was created with New-AzServiceFabricApplicationTypeVersion . The application parameters used should be defined in the application manifest.
Example 2
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
Update-AzServiceFabricApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -MinimumNodeCount 1 -MaximumNodeCount 4 -Verbose
This example will update the minimum and maximum number of nodes restriction for the application.
Example 3
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$version = "v2"
$packageUrl = "https://sftestapp.blob.core.windows.net/sftestapp/testAppType_v2.sfpkg"
New-AzServiceFabricApplicationTypeVersion -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -Version $version -PackageUrl $packageUrl -Verbose
Update-AzServiceFabricApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationTypeVersion $version -Name $appName -ApplicationParameter @{key0="value0";key1=$null;key2="value2"} -HealthCheckStableDurationSec 0 -HealthCheckWaitDurationSec 0 -HealthCheckRetryTimeoutSec 0 -UpgradeDomainTimeoutSec 5000 -UpgradeTimeoutSec 7000 -FailureAction Rollback -UpgradeReplicaSetCheckTimeoutSec 300 -ForceRestart
This example will start an application upgrade to update the type version to "v2" and also sets some upgrade policy parameters that will take effect from the current upgrade.
Example 4
Update-AzServiceFabricApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -ApplicationParameter @{key0="value0";key1=$null;key2="value2"}
This example updates the application parameters but these changes will only take effect until the next version upgrade to the application.
Parameters
-ApplicationParameter
Specify the application parameters as key/value pairs.
These parameters must exist in the application manifest.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ApplicationTypeVersion
Specify the application type version
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: 3
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: 3
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ClusterName
Specify the name of the cluster.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ConsiderWarningAsError
Indicates whether to treat a warning health event as an error event during health evaluation.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultServiceTypeMaxPercentUnhealthyPartitionsPerService
Specifies the maximum percent of unhealthy partitions per service allowed by the health policy for the default service type to use for the monitored upgrade.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultServiceTypeMaxPercentUnhealthyReplicasPerPartition
Specifies the maximum percent of unhealthy replicas per service allowed by the health policy for the default service type to use for the monitored upgrade.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultServiceTypeUnhealthyServicesMaxPercent
Specifies the maximum percent of unhealthy services allowed by the health policy for the default service type to use for the monitored upgrade.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-FailureAction
Specifies the action to take if the monitored upgrade fails.
The acceptable values for this parameter are Rollback or Manual.
Parameter properties
Type: FailureAction
Default value: None
Accepted values: Rollback, Manual
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ForceRestart
Indicates that the service host restarts even if the upgrade is a configuration-only change.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HealthCheckRetryTimeoutSec
Specifies the duration, in seconds, after which Service Fabric retries the health check if the previous health check fails.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HealthCheckStableDurationSec
Specifies the duration, in seconds, that Service Fabric waits in order to verify that the application is stable before moving to the next upgrade domain or completing the upgrade.
This wait duration prevents undetected changes of health right after the health check is performed.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HealthCheckWaitDurationSec
Specifies the duration, in seconds, that Service Fabric waits before it performs the initial health check after it finishes the upgrade on the upgrade domain.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The application resource.
Type: PSApplication
Default value: None
Supports wildcards: False
DontShow: False
ByInputObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-MaximumNodeCount
Specifies the maximum number of nodes on which to place an application
Parameter properties
Type: Int64
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-MinimumNodeCount
Specifies the minimum number of nodes where Service Fabric will reserve capacity for this application
Parameter properties
Type: Int64
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Specify the name of the application
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ApplicationName
Parameter sets
ByResourceGroup
Position: 2
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Specify the name of the resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ResourceId
Arm ResourceId of the application.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceId
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ServiceTypeHealthPolicyMap
Specifies the map of the health policy to use for different service types as a hash table in the following format: @ {"ServiceTypeName" : "MaxPercentUnhealthyPartitionsPerService,MaxPercentUnhealthyReplicasPerPartition,MaxPercentUnhealthyServices"}.
For example: @{ "ServiceTypeName01" = "5,10,5"; "ServiceTypeName02" = "5,5,5" }
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UnhealthyDeployedApplicationsMaxPercent
Specifies the maximum percentage of the application instances deployed on the nodes in the cluster that have a health state of error before the application health state for the cluster is error.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UpgradeDomainTimeoutSec
Specifies the maximum time, in seconds, that Service Fabric takes to upgrade a single upgrade domain.
After this period, the upgrade fails.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UpgradeReplicaSetCheckTimeoutSec
Specifies the maximum time that Service Fabric waits for a service to reconfigure into a safe state, if not already in a safe state, before Service Fabric proceeds with the upgrade.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UpgradeTimeoutSec
Specifies the maximum time, in seconds, that Service Fabric takes for the entire upgrade.
After this period, the upgrade fails.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceGroup
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
ByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
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 .
Outputs