It seems to be an authentication problem, you can try to use StorageSharedKeyCredential to authenticate.
const sourceCert = new StorageSharedKeyCredential(sourceAccountName,sourceAccountKey)
const sourceBlobServiceClient = new BlobServiceClient(
`https://${sourceAccountName}.blob.core.windows.net`,
sourceCert
);
const destinationCert = new StorageSharedKeyCredential(destinationAccountName,destinationAccountKey)
const destBlobServiceClient = new BlobServiceClient(
`https://${destinationAccountName}.blob.core.windows.net`,
destinationCert
);
const sourceContainer = sourceBlobServiceClient.getContainerClient(containerName);
const destContainer = destBlobServiceClient.getContainerClient(containerName);
await destContainer.createIfNotExists();
const sourceBlob = sourceContainer.getBlobClient(blobName);
const destBlob = destContainer.getBlobClient(sourceBlob.name);
const response = await destBlob.beginCopyFromURL(sourceBlob.url);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…