Azure does not natively support creating UsedCapacity alerts for file shares.
The following does not work.
$env:STORAGE_RESOURCE_GROUP = sudo az storage account show -n $env:STORAGE_CREDENTIALS_ID --query resourceGroup -o tsv;
$env:STORAGE_SHARE_ID = sudo az storage share-rm show `
-n $env:STORAGE_SHARE_NAME `
-g $env:STORAGE_RESOURCE_GROUP `
--account-name $env:STORAGE_CREDENTIALS_ID `
--query id -o tsv;
sudo az monitor metrics alert create `
--name "file-share-80-percent" `
--resource-group $env:STORAGE_RESOURCE_GROUP `
--scopes $env:STORAGE_SHARE_ID `
--condition "avg UsedCapacity > $([math]::Round(([int]$env:STORAGE_SIZE * 1GB) * 0.8))" `
--window-size PT5M `
--evaluation-frequency PT5M `
--severity 2 `
--description "Alert when file share used capacity is high";
Its possible by used log-analytics query to build a alert rule.
Azure does not natively support creating
UsedCapacityalerts for file shares.The following does not work.
Its possible by used log-analytics query to build a alert rule.