You have an Azure subscription that contains a General Purpose v1 (GPv1) storage account named storage1 in a resource group named group1. You need to implement an Azure Blob Storage lifecycle management policy to automatically move inactive blobs to the Cool and Archive tiers. You plan to define the policy rules in a local file named policy.json and apply the policy using the Azure CLI. Which four actions should you perform in sequence? To answer, arrange the actions in the correct order.
- 1Upgrade the storage account from General Purpose v1 (GPv1) to General Purpose v2 (GPv2).
- 2Create a local file named policy.json containing the lifecycle management rules, filters, and actions.
- 3Run the az storage account management-policy create command to apply the policy to the storage account.
- 4Run the az storage account management-policy show command to verify that the policy is active.
Answer
To implement the lifecycle management policy, you must first upgrade the storage account from GPv1 to GPv2 because GPv1 does not support lifecycle policies. Next, you create the local policy.json file containing the policy rules. Then, you apply the policy to the storage account by running the az storage account management-policy create command. Finally, you verify that the policy is active by running the az storage account management-policy show command.
Upgrading the storage account from GPv1 to GPv2 is required first because lifecycle management policies are not supported on GPv1 accounts. Once upgraded, the rules must be defined in a JSON file. This file is then passed to the create command to apply the policy, and finally, the show command is run to verify the policy is active.
Step-by-Step Solution
Key Concept
Azure Blob Storage Lifecycle Management requires a GPv2 (or compatible) storage account and can be applied via the Azure CLI using a JSON policy file.