Tuesday, April 10, 2018

Scale out Azure SQL Database



I have a SQL Database in Azure. An S0 instance with 10 DTUs. This is enough 95% of the time.



However, when the App Service plan scales out (can go up to 20x in rare cases), I need 200/400 DTUs. Since this will not happen very often, so it would be a waste to always pay for these sizes. Is there a way to scale out the database when the app service scales out?



Thank you!



Answer



There's no direct way to have a DB scale up when a Web App does, but there is a workaround. You can have the scale up action on the web app trigger a webhook, so you can have that call either Azure Automation or an Azure Function, which then talks to the ARM API to scale up or down your SQL DB.



See here to see how to trigger a webhook on scaling.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...