Stpete111
Stpete111

Reputation: 3437

Azure Service Fabric - trying to update key-value parameters of an application using Powershell

I am trying to update the Key-Value parameters of one of my Service Fabric applications. Right now the application version is 2.0.20. This is the script my former dev gave to me to update the key-value parameters:

New-ServiceFabricApplication -ApplicationName fabric:/Cantanilla.Jef -ApplicationTypeName Cantanilla.Application.JefType -ApplicationTypeVersion 2.0.20 -ApplicationParameter @{key:value pairs}

I can't get this script to work. The issue is that if I run this with version 2.0.20, I get the error Application already exists. If I run it with version 2.0.21, I get the error Application type and version not found.

How can I accomplish this? The dev said this script definitely worked for them.

Upvotes: 0

Views: 198

Answers (1)

Diego Mendes
Diego Mendes

Reputation: 11351

You can't get it to work with 2.0.21 because you first have to Copy the new version 2.0.21 to the Image store with the command Copy-ServiceFabricApplicationPackage and then register as a valid package version with Register-ServiceFabricApplicationType

Also, the command New-ServiceFabricApplication that you tried, will create a new application, instead of updating the old one.

To update the old one, you have to use the command Start-ServiceFabricApplicationUpgrade.

The following command should work:

Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/Cantanilla.Jef -ApplicationTypeVersion 2.0.20 -Monitored -FailureAction Rollback -ApplicationParameter @{key:value pairs}

Keep in mind that you have to provide all the parameters specified when you deployed the application, some might not be possible to change.

Upvotes: 1

Related Questions