Set-AzServiceFabricManagedClusterApplication
Update a service fabric managed application. This allows to update the application parameters and/or upgrade the application type version which will trigger an application upgrade or other configuration only updates. Only supports ARM deployed applications.
Syntax
ByResourceGroup (Default)
Set-AzServiceFabricManagedClusterApplication
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-Name] <String>
[[-ApplicationTypeVersion] <String>]
[-ApplicationParameter <Hashtable>]
[-ForceRestart]
[-RecreateApplication]
[-UpgradeReplicaSetCheckTimeoutSec <Int32>]
[-InstanceCloseDelayDurationSec <Int32>]
[-UpgradeMode <ApplicationUpgradeMode>]
[-FailureAction <FailureAction>]
[-HealthCheckRetryTimeoutSec <Int32>]
[-HealthCheckWaitDurationSec <Int32>]
[-HealthCheckStableDurationSec <Int32>]
[-UpgradeDomainTimeoutSec <Int32>]
[-UpgradeTimeoutSec <Int32>]
[-ConsiderWarningAsError]
[-DefaultServiceTypeMaxPercentUnhealthyPartitionsPerService <Int32>]
[-DefaultServiceTypeMaxPercentUnhealthyReplicasPerPartition <Int32>]
[-DefaultServiceTypeUnhealthyServicesMaxPercent <Int32>]
[-UnhealthyDeployedApplicationsMaxPercent <Int32>]
[-ServiceTypeHealthPolicyMap <Hashtable>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByResourceId
Set-AzServiceFabricManagedClusterApplication
[[-ApplicationTypeVersion] <String>]
-ResourceId <String>
[-ApplicationParameter <Hashtable>]
[-ForceRestart]
[-RecreateApplication]
[-UpgradeReplicaSetCheckTimeoutSec <Int32>]
[-InstanceCloseDelayDurationSec <Int32>]
[-UpgradeMode <ApplicationUpgradeMode>]
[-FailureAction <FailureAction>]
[-HealthCheckRetryTimeoutSec <Int32>]
[-HealthCheckWaitDurationSec <Int32>]
[-HealthCheckStableDurationSec <Int32>]
[-UpgradeDomainTimeoutSec <Int32>]
[-UpgradeTimeoutSec <Int32>]
[-ConsiderWarningAsError]
[-DefaultServiceTypeMaxPercentUnhealthyPartitionsPerService <Int32>]
[-DefaultServiceTypeMaxPercentUnhealthyReplicasPerPartition <Int32>]
[-DefaultServiceTypeUnhealthyServicesMaxPercent <Int32>]
[-UnhealthyDeployedApplicationsMaxPercent <Int32>]
[-ServiceTypeHealthPolicyMap <Hashtable>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzServiceFabricManagedClusterApplication
[[-ApplicationTypeVersion] <String>]
-InputObject <PSManagedApplication>
[-ApplicationParameter <Hashtable>]
[-ForceRestart]
[-RecreateApplication]
[-UpgradeReplicaSetCheckTimeoutSec <Int32>]
[-InstanceCloseDelayDurationSec <Int32>]
[-UpgradeMode <ApplicationUpgradeMode>]
[-FailureAction <FailureAction>]
[-HealthCheckRetryTimeoutSec <Int32>]
[-HealthCheckWaitDurationSec <Int32>]
[-HealthCheckStableDurationSec <Int32>]
[-UpgradeDomainTimeoutSec <Int32>]
[-UpgradeTimeoutSec <Int32>]
[-ConsiderWarningAsError]
[-DefaultServiceTypeMaxPercentUnhealthyPartitionsPerService <Int32>]
[-DefaultServiceTypeMaxPercentUnhealthyReplicasPerPartition <Int32>]
[-DefaultServiceTypeUnhealthyServicesMaxPercent <Int32>]
[-UnhealthyDeployedApplicationsMaxPercent <Int32>]
[-ServiceTypeHealthPolicyMap <Hashtable>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This cmdlet can be used to update application parameters and upgrade the application type version along with other configuration only updates. 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-AzServiceFabricManagedClusterApplicationTypeVersion .
Examples
Example 1
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$version = "v2"
$packageUrl = "https://sftestapp.blob.core.windows.net/sftestapp/testAppType_v2.sfpkg"
New-AzServiceFabricManagedClusterApplicationTypeVersion -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -Version $version -PackageUrl $packageUrl -Verbose
Set-AzServiceFabricManagedClusterApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationTypeVersion $version -Name $appName -ApplicationParameter @{key0="value0";key1=$null;key2="value2"} -Tag @{tag0="updated"}
This example will start an managed application upgrade to update the type version to "v2" which was created with New-AzServiceFabricManagedClusterApplicationTypeVersion . The application parameters used should be defined in the application manifest.
Example 2
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
Set-AzServiceFabricManagedClusterApplication -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -FailureAction Rollback -ForceRestart:$false -Verbose
This example will updates the FailureAction and sets ForceRestart to false.
Example 3
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$version = "v2"
$packageUrl = "https://sftestapp.blob.core.windows.net/sftestapp/testAppType_v2.sfpkg"
New-AzServiceFabricManagedClusterApplicationTypeVersion -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Name $appName -Version $version -PackageUrl $packageUrl -Verbose
Set-AzServiceFabricManagedClusterApplication -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
Set-AzServiceFabricManagedClusterApplication -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
(All)
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
(All)
Position: 3
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AsJob
Run cmdlet in the background and return a Job to track progress.
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
-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
(All)
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
(All)
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
(All)
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
(All)
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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Force
Continue without prompts
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
-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
(All)
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
(All)
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
(All)
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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The managed application resource.
ByInputObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-InstanceCloseDelayDurationSec
Specifies the duration in seconds, to wait before a stateless instance is closed, to allow the active requests to drain gracefully.
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
-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
-RecreateApplication
Determines whether the application should be recreated on update.
If value=true, the rest of the upgrade policy parameters are not allowed.
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
-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 managed application.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByResourceId
Position: Named
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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Tag
Specify the tags as key/value pairs.
Parameter properties
Type: Hashtable
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: True
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
(All)
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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UpgradeMode
The mode used to monitor health during a rolling upgrade.
The values are Monitored, and UnmonitoredAuto.
Parameter properties
Type: ApplicationUpgradeMode
Default value: None
Accepted values: Monitored, UnmonitoredAuto
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
-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
(All)
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
(All)
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