Rollback Azure ad fabric
I have a Service Fabric application. Let's say version 1.0.0. I am deploying the update as version 2.0.0. Things are good.
Later I want to rollback (or upgrade depending on your perspective) to 1.0.0.
I want to run a simple PS script to rollback.
I know similar questions have been asked (in different forms) but no one has given a solution. It seems to be something in general that should be trivial. I don't need a tutorial on how publishing works. I just need a PS script that I can execute in order to roll back.
Running 5.5, I tried the Start-ServiceFabricApplicationUpgrade permutation.
Most often, this leads to an error of the following type:
Start-ServiceFabricApplicationUpgrade: The default service descriptions cannot be changed as part of an upgrade. modified default service: fabric: / xxx. To enable this, set EnableDefaultServicesUpgrade to true.
I really don't want to mess with the internals to set some kind of switch. The documentation is so limited that I can't even figure out what to do without risking the integrity of my tissue. And I don't know how to change my local structure to get this setting.
Can anyone give me just a straight PS script to do this task?
source to share
After looking at several answers, I came up with the following script that seems to work in all cases where I tested it.
Connect-ServiceFabricCluster
$app = Get-ServiceFabricApplication -ApplicationName "fabric:/xxx"
$table = @{}
$app.ApplicationParameters | ForEach-Object { $table.Add($_.Name, $_.Value) }
Start-ServiceFabricApplicationUpgrade -ApplicationName "fabric:/xxx" -ApplicationTypeVersion 1.0.0 -HealthCheckStableDurationSec 60 -UpgradeDomainTimeoutSec 1200 -UpgradeTimeout 3000 -FailureAction Rollback -Monitored -ApplicationParameter $table
source to share