Count files in Blob

Posted: July 19, 2023  |  Categories: Azure

I show a Powershell script to count files in blob. I have a problem with files not being picked up from a Logic App Blob trigger. I wrote this script to monitor my issue because I could not find a ready made alert in Azure.

$ctx = New-AzStorageContext -StorageAccountName "auebdintegrationprod" 
# -StorageAccountKey "mykey"
Get-AzStorageBlob -Container "ediextracts" -Context $ctx | Where-Object {$_.Name -notlike "*Processed*"} | Select-Object -Property Name
(Get-AzStorageBlob -Container "ediextracts" -Context $ctx | Where-Object {$_.Name -notlike "*Processed*"}).count

I hope this might be useful to someone else. Enjoy.


Back to Top