0
votes

Hi I wanted to find out if there is a way to automate the process of creating a lifecycle management rule which moves base blobs to cool tier after 90 days and then after 30 days moves them to archive. I want to automate this for like 20 storage accounts in Azure. Is there a powershell script that can be run on a runbook in an automation account?

1

1 Answers

0
votes

You should be able to adapt the sample in the documentation link here - https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccountmanagementpolicyrule?view=azps-6.3.0 . The first example creates a rule and applies it to an existing storage account.

If you're unsure what the rule JSON should look like, you can build a sample rule in the Azure portal and then look at the code view prior to saving the rule to download or view the json behind the rule.