We have a setup where we create a new client database in Azure SQL for each new client. These are added to specific elastic pools (with different pricing tiers, depending on client tier). Unfortunately, when one of these elastic pools is full, no new clients can be created. We also don’t want to automatically upgrade the service at this point for several reasons (unimportant).
We would like to be alerted when one of the elastic pools reaches its capacity limit. Currently we have to regularly check this by hand. There are no alert rules that can provide this kind of information (as far as I know).
Ideally, I would like to run an Azure PowerShell script once a day and be alerted if some threshold is reached.
So far, I have investigated several options.
As I already wrote a PowerShell script that extracts the number of databases per elastic pool, I would like to build upon this. I investigated the following options:
- Using an Azure Automation Account, I can run the script on the Azure client with a managed identity. What can I do with the result now? What is the best option?
- I saw that it might be possible to collect custom data logs in Azure Monitor but the only tutorial I found for that requires me to create and register a new application. This seems a bit too much for this small problem.
- Coming back to the Azure Automation script, I thought about sending an E-Mail directly from the script but I wouldn’t know how to do that. Creating a new E-Mail account just for this seems too much, too.
Are there any possibilities I missed? How would you solve this problem? I am grateful for any input you can give me. Thanks!
1