First Why I'm doing this:
I have a WCF service deployed as an Azure Webrole using HTTPS as endpoint. I need to have a custom "load balancer probe" set for this service. Azure load balancers does not support HTTPS, so I've deployed a second website with http endpoint to use it as my "load balancer prob"
So What's my problem?!
I have a webrole with two websites like:
<WebRole name="WebRole1" vmsize="Medium">
<Sites>
<Site name="Web" physicalDirectory="roles\WebRole1">
<Bindings>
<Binding name="Web" endpointName="WebRoleEndpoint" />
</Bindings>
</Site>
<Site name="Web2" physicalDirectory="roles\HealthProb">
<Bindings>
<Binding name="Web" endpointName="HealthProbEndpoint" />
</Bindings>
</Site>
</Sites>
...
it is recommended to handle the RoleEntryPoint.OnStop() to make sure you return the correct health status code to the loadbalancer (http://blog.mdavies.net/2013/04/27/custom-load-balancing-endpoints-azure-web-worker-vm-role/)
my problem is how I can hendle the RoleEntryPoint.OnStop() in my second website. though in the webrole I can easily do this by extending and overriding the RoleEntryPoint.OnStop(), in the second website I cant handle that event.
Is there any way that I can handle the OnStop or some similar event in the second website?!