How to create a PS/CLI script for file share capacity alert with Action group

Sutheswaran, Suwhathi 70 Reputation points
2024-07-04T10:14:43.54+00:00

I want to create an alert for file capacity of files and I need an action group as well.

Problem is that the storage account has 90 files and i need for each fileshare 1 Alert.

I want to try using a script to avoid taking a lot of time doing it manually.

Can someone help me with this?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,306 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
337 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,570 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 46,801 Reputation points
    2024-07-05T15:47:27.8666667+00:00

    I think the New-AzMetricAlertRuleV2 cmdlet is what you're looking for. If you need to work with "classic" alerts, the Add-AzMetricAlertRule might be what you want.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.