简体   繁体   中英

Azure Service Fabric Rollback

I have a Service Fabric application. Let's say, version 1.0.0. I deploy an update as version 2.0.0. Everything is good.

Later, I want to roll back (or upgrade depending on your perspective) to version 1.0.0.

I want to run a simple PS script to rollback.

I know similar questions has been asked (in various forms), but no one has provided a solution. It seems like something common which should be trivial to accomplish. I don't need a tutorial on how publish works. I just want some PS script I can run to do the rollback.

Running 5.5, I have tried permutations of Start-ServiceFabricApplicationUpgrade.

Most commonly, this result in an error of the following form:

Start-ServiceFabricApplicationUpgrade : Default service descriptions can not be modified as part of upgrade. Modified default service: fabric:/xxx. To allow it, set EnableDefaultServicesUpgrade to true.

I really don't want to fiddle with internals to set some switch. The documentation is so limited that I can't even figure out exactly what do without risking the integrity of my fabric. And, I've no clue at all how I would change my local fabric to get this setting.

Can anybody give me just a straight forward PS script to accomplish this task?

Borrowing on several answers, I came up with the following script which seems to work in all cases where I have 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM