Stpete111
Stpete111

Reputation: 3437

Azure Service Fabric - selective update of service parameters with Powershell?

We have an Azure Service Fabric Cluster with several apps and services. Some of the services contain up to 50 parameters (meaning the Key:Value pairs that you would see if you clicked on the Details tab of a given service in Service Fabric Explorer).

I need to update just one of these parameters out of a list of 50+. One of my devs is under the impression that the only way you can make a change to one of these parameters is run a Powershell script that contains all of the service's parameters within the script. In other words, if you try to run the script with only the parameter you want to update, you will erase all the other parameters.

Question 1: is there truly no way to update just one Service Fabric service parameter without including all of the existing parameters in the script?

Question 2: are there any tools/templates out there that help you build the Powershell script to make these kinds of changes in Service Fabric?

Upvotes: 0

Views: 496

Answers (2)

SteppingRazor
SteppingRazor

Reputation: 1272

Once the application is deployed to the cluster it is possible to connect to the cluster and retrieve list of the current parameters, running Get-ServiceFabricApplication command.

So it can be achieved by custom PowerShell script. During the deploy you can gather existing parameter values and combine with new parameters. Then you pass combined parameters and deploy the application. Should not be that hard to do.

That's the one way I can think of. And I don't think there is some built in functionality for this. And yes the developer is right you always have to provide all parameters.

Upvotes: 2

Diego Mendes
Diego Mendes

Reputation: 11351

AFAIK there is no way to update just one parameter.

Service fabric has the concept of packages (Code, Config, Data) where you can change one of then without changing the others, in your case, you have to change the Config only, but each change generates a new version, and the change must include all the data, because you are replacing the previous version, not amending it.

The "right way" (best) to release SF apps is using a CI/CD tool like VSTS to automate these changes, not running scripts by hand, because it is hard to keep track of changes and soon or later, small changes like the one you want to do, become a huge pain.

If these releases were controlled using a CD tool, like VSTS, Octopus, Jenkins, you would just change the values and trigger a new release.

Upvotes: 3

Related Questions