How to find hot or cool files

Roberto Quintela 1 Reputation point
2021-02-15T07:52:30.633+00:00

Hi

Is there some way or script to search in your blob container which files are hot or cool to change the to archive?

I have thousand of folders and files and to make this work manually is a nightmare

Thanks

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,089 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 40,806 Reputation points Microsoft Employee
    2021-02-15T11:30:08.14+00:00

    @Roberto Quintela Welcome to Microsoft Q&A, Thank you for posting your query!

    This cmdlets provides details of the container:

    Get-AzStorageAccount -ResourceGroupName "" -Name ""  
      
    $ctx = New-AzStorageContext -StorageAccountName "" -StorageAccountKey rvm0vmuj58uO62WOsK  
    Get-AzStorageContainer -Context $ctx  
      
    $ContainerName = "test"  
      
    Get-AzStorageBlob -Container $ContainerName -context $ctx  
    

    The following PowerShell script can be used to change the blob tier of an archive blob. The $rgName variable must be initialized with your resource group name. The $accountName variable must be initialized with your storage account name. The $containerName variable must be initialized with your container name. The $blobName variable must be initialized with your blob name.

    #Initialize the following with your resource group, storage account, container, and blob names  
    $rgName = ""  
    $accountName = ""  
    $containerName = ""  
    # If required $blobName = ""  
      
    #Select the storage account and get the context  
    $storageAccount =Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountName  
    $ctx = $storageAccount.Context  
      
    #Select the blob from a container  
    $blob = Get-AzStorageBlob -Container $containerName -Context $ctx  
      
    #Change the blob’s access tier to Hot using Standard priority rehydrate  
    $blob.ICloudBlob.SetStandardBlobTier("cool", "Standard")  
    

    68146-capture.png

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    ---------------------------------------------------------------------------------------------------------------------------------

    Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.