Search code examples
.netazurewindows-servicesredundancy

Solution for Windows service failover system on MS Azure


We have a server environment with two different virtual machines each running a subset of our Windows services (about 50 in total split equally) created in .NET. What I'm looking for is the best way to automatically start the remaining services on the other VM should the one of them go down.

The reason we need this solution is that we're running these VMs on the cloud (MS Azure) which can get restarted semi-regularly. These services are also fairly hard to implement as actual horizontal scaling systems (especially the legacy services). So what we're after is essentially a form of redundancy system.

We've considered doing a custom solution ourselves using our centralized SQL database (also on Azure), but we'd rather prefer to use an existing solution if possible. Google has yielded very little on the topic. So far the only tool we've found that allows this is using Docker with some extensions. But Docker also has many more features that we don't need and has a non-trivial barrier to entry (but is still an option obviously).


Solution

  • You could use Azure Automation to poll the VM with the services and when a service is offline, do X on another VM. Azure recently released Task Watcher(subset to automation) that can poll with 1 minute granularity. note that it is in preview but it gives you sommething that you don't have today.

    https://azure.microsoft.com/en-au/updates/azure-automation-watcher-tasks-public-preview-now-available/