Azure Service Fabric Rollback

浪子不回头ぞ 提交于 2019-12-06 07:16:32

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/43265395/azure-service-fabric-rollback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!