I want to create an alert on azure SQL MI if storage space is used more than 80%.But not found any condition on storage space used percentage. Image is attched that shows available options to set alert
As per this document below are the available options to create alerts in SQL managed instance.
So, there is no direct way to create alert to when SQL MI storage is greater than 80%. You can follow below procedure to get alert:
Enable diagnostic settings in SQL managed instance as mentioned below:
Create log search alert in log analytics workspace with below query:
AzureMetrics
| extend p = pack(MetricName, Average)
| summarize bag = make_bag(p) by TimeGenerated
| evaluate bag_unpack(bag)
| extend reserved_storage = reserved_storage_mb
| extend used_storage = storage_space_used_mb
| extend storage_used_percentage = round(100.0 * used_storage / reserved_storage)
| project TimeGenerated, storage_used_percentage, reserved_storage, used_storage
| where storage_used_percentage >= 80
As mentioned in below image:
You will be able to get alert when SQL MI storage is greater than 80%. For more information you can refer this SO thread.