none
RESPONSE ERROR (ServiceCode=AuthorizationPermissionMismatch) RRS feed

  • Question

  • I have a batch file that copies a file from local storage to Azure blob. If i run the batch file from the CMD or call it from PS it works without any issues, however if i take the code from the batch file and paste it in to PS it fails with ===== RESPONSE ERROR (ServiceCode=AuthorizationPermissionMismatch) =====

    C:\Prod\azcopy.exe copy "C:\export\reports\sales.csv" "https://XYZblob.blob.core.windows.net/sales/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2020-09-17T04:11:04Z&st=2019-09-16T20:11:04Z&spr=https&sig=CDcugdgfLRVco10WWxSVASQTavc7Ljyzcuw5imz6WYc%%3D" 

    INFO: Scanning...

    Job e5a1f5a1-a472-2642-65a3-f46cb7d20428 has started
    Log file is located at: C:\Users\vsmith/.azcopy/e5a1f5a1-a472-2642-65a3-f46cb7d20428.log


    0 Done, 0 Failed, 1 Pending, 0 Skipped, 1 Total, 


    Job e5a1f5a1-a472-2642-65a3-f46cb7d20428 summary
    Elapsed Time (Minutes): 0.0334
    Total Number Of Transfers: 1
    Number of Transfers Completed: 0
    Number of Transfers Failed: 1
    Number of Transfers Skipped: 0
    TotalBytesTransferred: 0
    Final Job Status: Failed

    Does anyone know why the execution in CMD works, but not in powershell? Also what would prevent someone from outside to upload files to the blob I created I am not being prompted to authenticate when using AzCopy

    Thanks 

    Tuesday, September 17, 2019 1:32 PM

All replies

  • Powershell has a distinct argument from what's used in CMD, my guess is it could be a parameter in which is not recognized in PS causes the error message. 

    It would be also good to post the code. 

    Azcopy requires login, by initially using: azcopy login

    however the timeout could be long, possibly you logged in a while back , which may explain why you weren't prompted afterwards ?

    This documentation shows the full supported ways of authentication in Azcopy: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10

    L
    et me know if this helps.

    Thanks,

    Adam

    Tuesday, September 17, 2019 9:50 PM
    Moderator
  • log in is not required if SAS is used, but I have the restriction by the IP address. I can run the batch file from any computer domain network or remote and it woks. 

    Does azcopy behave differently in PS ? it's the same exe I am running in CMD and ISE


    • Edited by net_tech Tuesday, September 17, 2019 10:48 PM
    Tuesday, September 17, 2019 9:57 PM
  • It should behave the same on both cmd and powershell. Which version of Azcopy are you using ?
    Tuesday, September 17, 2019 10:03 PM
    Moderator
  • https://aka.ms/downloadazcopy-v10-windows    - 10.2.1

    Tuesday, September 17, 2019 10:05 PM