Search code examples
azureazure-storageazure-blob-storageazcopy

Change Tier on Azcopy


I need to download multiple archived files from Azure Storage Account StorageV2 (general purpose v2), but it seems that I need first to rehydrate them from archive to cold or hot tier first.

Is there a way in AzCopy (I'm using AzCopy V10.10.0) to change the tier of a file which is already uploaded?

I really like AzCopy as it's easy to use with the SAS token. Thank you in advance!


Solution

  • You cannot access data that is stored on the archive tier, without rehydrating it first.

    You can use powershell to copy from the archive tier to hot tier storage. You will then be able to copy with AzCopy.

    #Initialize the following with your resource group, storage account, container, and blob names
    $rgName = ""
    $accountName = ""
    $srcContainerName = ""
    $destContainerName = ""
    $srcBlobName = ""
    $destBlobName = ""
    
    #Select the storage account and get the context
    $storageAccount =Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountName
    $ctx = $storageAccount.Context
    
    #Copy source blob to a new destination blob with access tier hot using standard rehydrate priority
    Start-AzStorageBlobCopy -SrcContainer $srcContainerName -SrcBlob $srcBlobName -DestContainer $destContainerName -DestBlob $destBlobName -StandardBlobTier Hot -RehydratePriority Standard -Context $ctx
    

    See: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-rehydration?tabs=azure-powershell#quickstart-scenarios