I am running a stateless service in Azure Service Fabric in the .NET Framework. I want to perform some clean up activities, and remove some configurations from the registry if all of my applications get deleted from a node in my Service Fabric Cluster. Is there any way that I can do this?
Asked
Active
Viewed 206 times
1 Answers
1
Yes, you can do this by registering notification callbacks. Register for all applications and services by using this code:
var filterDescription = new ServiceNotificationFilterDescription
{
Name = new Uri("fabric:"),
MatchNamePrefix = true
};
You interpret a notification with no endpoints as a service deletion.
Have a look at this question too.

LoekD
- 11,402
- 17
- 27
-
Thank you @LoekD. That's what I was looking for. – Kiran Sep 05 '18 at 17:49
-
How is this different from OnCloseAsync() event?. It is called when the service instance is going to be gracefully shut down. – Blue Clouds Sep 06 '18 at 06:57
-
The nuance is in 'when all my application gets deleted'; you'd need to know the state of multiple services. – LoekD Sep 06 '18 at 10:14