azure blob

PowerShell – Delete Azure blobs older than X number of days

As a cost optimization strategy, organizations decide to retain data that are certain days old and delete the old data.

The same strategy can be implemented in Azure Storage. Let’s say if our application requires data that are 60 days old, then our approach is to retain only 60 days of data. And delete any blob that is older than 60 days.

This script deletes Azure blobs that are older than X days. Here ‘X’ is the number of days that you want to retain the data. (60, as stated in my example)

Download the script

You can create an Azure Automation Runbook from this script and schedule it to run every day. So, you will not be billed for the unwanted data.

Click here to download my PowerShell scripts for Free !!

Click here for Azure tutorial videos !!

 

 

Advertisements

PowerShell – Fetch Azure Page Blobs from an Azure subscription

This script fetches the details of PAGE BLOB across the Azure subscription and saves it as a CSV file. The CSV file will be saved under the location from where the script was run.

The general use case could be to understand how many VHD files are present in your subscription. These could be your OS Disks, Datadisks or your VM snapshots.

Download Script Link

If you are looking for a script that generates a report for “unattached” managed and un-managed disks, then please visit the below link:

AZURE – GENERATE REPORT FOR UNATTACHED AZURE DISKS (MANAGED AND UN-MANAGED)

 

Click here to download my PowerShell scripts for Free !!

Click here for Azure tutorial videos !!