0
votes

My goal is to send an alert when total capacity used in given storage is greater than x GB. I've try setup an alert via Azure Monitoring, but it does not work as expected.
I've set alert for couple MB upload larger than that file to storage and nothing happens.

Maybe I messed up something with configuration so here it is: config

Then I've try different approach thru REST API I found Microsoft.Azure.Management.Monitor.Fluent package and even one example on monitoring storage: https://github.com/Azure-Samples/monitor-dotnet-query-metrics-activitylogs

But this example is not working.
It creates storage in my account and deletes it at end as it should, but when it executes query for monitoring data it returns exception Bad Request - updating the nuget package to latest version doesn't solve the problem.

So here I am with a task which sound very simple, but it is not

Can anyone can put me to right direction?

1
Hello, have you solved your issue?Ivan Yang

1 Answers

0
votes

As per your condition: send an alert when total capacity used in given storage is greater than x GB. , then in the alert rule -> condition, you should select Total instead of Average for Time Aggregation.

You can follow the steps below, it works and send me alert when total used storage is more then 1GB.

1.Go to azure portal -> Monitor -> Alerts -> New alert rule, select your resource(your storage account):

enter image description here

2.Then Click Add condition, and select Used Capacity:

enter image description here

3.Then in the condition section, select Total for Time Aggregation(and I set the threshold to 1GB):

enter image description here

4.Configure other settings, and create the rule successfully.

5.Try to upload some files to generate the alert.

6.If it's triggered, you can receive an alert email:

enter image description here