0
votes

I am trying to copy data from one azure storage account in one subscription to other azure storage account in different subscription. For that I had created an azure function using powershell script.

This script is working fine when copy content from one storage account to other storage account but did not works for different subscription

=========

$SrcStgAccURI = "https://trimarinestage.blob.core.windows.net/"
$SrcSASToken = "?sr=b&sv=2019-12-12&ss=b&srt=sco&sp=rlx&se=2024-09-23T16:19:37Z&st=2020-09-23T08:19:37Z&spr=https&sig=tVcutYO6P2ytRpiEahO92wCJZh8I5ORRS7JYKtI2ADU%3D"
$SrcFullPath = "$($SrcStgAccURI)?$($SrcSASToken)"

$DstStgAccURI = "https://backuptops.file.core.windows.net/"
$DstSASToken = "?sv=2020-08-04&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2025-09-13T23:07:44Z&st=2021-09-13T15:07:44Z&spr=https&sig=Dj9myrNkmNp5GCbs31yDiV5zsyz41EJfnY8sJ9oaAWM%3D"
$DstFullPath = "$($DstStgAccURI)?$($DstSASToken)"

Getting following error:

2021-09-16T07:30:04.614 [Error] Executed 'Functions.BackUp' (Failed, Id=2e0f1798-8b9c-45fc-b652-7350daa4fceb, Duration=42ms)Could not create BlobServiceClient to obtain the BlobContainerClient using Connection: Storage

i am using following code: Write-Host "Backing up storage account..." ./azcopy.exe copy $SrcFullPath $DstFullPath --recursive --overwrite=ifsourcenewerKaushik Debnath