Scaling Azure Search Service using Runbooks
One of our customers running on Azure has 10x spikes in traffic during certain day of a week. Since the spikes are predictable and only for certain days, instead of running all services at max capacity, we only scale them up before these spikes and scale them down post the spike in line with the true essence of elasticity of the cloud. We’ve been using Azure Search Services and up the replicaset before the spike. Azure provides Runbooks for automating such actions. There are quite a few runbooks already available on the Azure Community Gallery which can be either used as-is or modified to suit our requirements. Unfortunately, there ain’t any Runbook for scaling up/down the search services replicaset (at least at the time of writing this). So we ended up rolling one of our own, below in all its glory:
The only issue with Runbooks is that currently there’s no way of being notified if the runbook actually succeeded or not so it requires a bit of manual check after, this is a real pain for “async” runbooks like scaling the SQL DB up/down since the runbook would actually succeed but the actual scale operation might fail.