I am using @azure-tools/azcopy-node npm package to preforme copy between two storage accounts.
I have the below code (tried both with SAS token and storage connection string) and i'm getting the following error:
"failed to perform copy command due to error: no SAS token or OAuth token is present and the resource is not public"
var client = new AzCopyClient();
const src = <IRemoteKeyLocation>{
resourceUri: "https://srcaccount.blob.core.windows.net/",
accountKey: "xxxxx",
accountName: "srckey",
path: "somepath"
}
const dst = <IRemoteKeyLocation>{
resourceUri: "https://dststorage.blob.core.windows.net/",
accountName: "dstacount",
accountKey: "xxxxx",
path: "copy-test"
}
var jobId = await client.copy(src, dst, {recursive: true});
IRemoteKeyLocationdefinition, please try to put thecontainer_nameat the end of theresourceUri, and notrailing slashes. - Ivan Yang