How can I restart a service fabric stateful service, actually its an actor service. I want to get this working locally. Note that this is a local instance.
I've tried the following powershell command
Restart-ServiceFabricReplica -ServiceName fabric:/MyNameSpace.Dashboard.SfApp
but I get this error
Restart-ServiceFabricReplica : Cluster connection instance is null
At line:1 char:1
+ Restart-ServiceFabricReplica -ServiceName fabric:/MyNameSpace.Da ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Restart-ServiceFabricReplica], NullReferenceException
+ FullyQualifiedErrorId : GetClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.RestartReplica
I've also tried this but don't know whats going on with this long syntax one, again same error though.
Restart-ServiceFabricDeployedCodePackage -ApplicationName fabric:/MyNameSpace.Dashboard.SfApp -NodeName "_Node_0" -ServiceManifestName "ServicePkg" -CodePackageName "Code" -ServicePackageActivationId 57f2ae77-6478-4f5d-af10-033bd4e4b4fa
I managed to get this working with an error that I later found is expected!
I firstly hadn't connected to the instance!
I then ran this command
In most cases the above command seems to error, but it doesn't really fail to restart. Its something to do with having just restarted the service with said command (found someone explain in the comments here Service Fabric Restart Application)
I didn't need to provide the
ServicePackageActivationId
parameter but if you needed that you could run this command to find outYou can also do this within service fabric management portal