Skip to content

Azure Storage Files Share Capacity Alert #104

@vivet

Description

@vivet

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions