Im having an issue related to the rehydration process while I'm trying to make a copy of one blob to another account.
I have two different clients, one for the source and other one for the dest:
BlobClient blobMeta = sourceClient.getBlobContainerClient(source.getContainer()).getBlobClient(key);
BlobClient destObject = destClient.getBlobContainerClient(dest.getContainer()).getBlobClient(key);
As I read in the docs, for doing a copy in a different account, you should add the SAS token ("If the source is in another account, the source must either be public or authenticated with a SAS token."), so...
OffsetDateTime sasExpiry = OffsetDateTime.now().plusMinutes(1);
BlobSasPermission permission = new BlobSasPermission().setReadPermission(true);
BlobServiceSasSignatureValues sas = new BlobServiceSasSignatureValues(sasExpiry,permission).setStartTime(OffsetDateTime.now());
String sourceURL = blobMeta.getBlobUrl() + "?" + blobMeta.generateSas(sas);
Once I have the different blobs and the SAS token I continue with the beginCopy operation setting the new options for the rehydration process (from Archive to Cool and the priority):
destObject.beginCopy(sourceURL, blobMeta.getProperties().getMetadata(), AccessTier.COOL, RehydratePriority.STANDARD, null, null, null);
Everything seems working properly but, this line creates directly the files with an 0B of size and there is no waiting time for rehydrate process (obviously is not doing anything, just copying empty info. However, the metadata is properly assigned). For the same account in a different container, everything works fine. Moreover, copying without adding the rehydration info (when the files are not stored in an archive tier) works fine too.
Does someone have any idea about what can be happening here?
Thank you!
I tried what I added above and I expect to copy the data with the correct size and content.
PD: The issue was the different region of the accounts. Begincopy method with the hydration process is not supported yet. For doing this, is necessary setting the tier to Cool / Hot in the original account and then, doing the copy.