I was testing to overwrite any file stored with archive tier on Azure and i'm getting next error (there is no problem for other tiers):
ERROR: File upload failed com.azure.storage.blob.models.BlobStorageException: BlobArchived
The methods which i'm using to copy the file are:
blob.uploadWithResponse(..); or blob.uploadFromFile(..);
Is there currently a simple way to avoid this issue and overwriting the files or its not possible for archive tier files? I tested manually (from Azure Storage) and it asks you about overwrite the data or not. Maybe there is some method in Java for doing this, but i'm not able to find it.
Thanks in advance!
Im trying to find a way to overwrite data for archive tier files in Java
When a blob is in the
Archive tier, it is set to beofflineand cannot be read or modified. Hence, you cannot overwrite a blob which is in the Archive tier.To overwrite a blob, you have to make sure the blob is online and isn't set to Archive.
This can be achieved using Rehydration in two ways:
Method 1:
Hot or Cool tierusingthe Copy Blob operation.Method 2:
archivetohot or coolwith theSet Blob Tieroperation.I have a Blob in Archive tier:
Output:
Cool tier:References:
Blob rehydration from the archive tier | Microsoft Learn Rehydrate an archived blob to an online tier - Azure Storage | Microsoft Learn