Home > database >  Azure azcopy fails after AAD success authentication
Azure azcopy fails after AAD success authentication

Time:12-06

I am trying to use azcopy tool from Ubuntu 20.04 to upload file to Azure Blob.

I am authenticated with AAD and SP:

export AZCOPY_SPA_CLIENT_SECRET="12345678"
azcopy login --service-principal  --application-id abc --tenant-id=xyz

Here I get auth success:

INFO: SPN Auth via secret succeeded.

However when I run:

azcopy copy './myfile' 'https://mystorageacc.blob.core.windows.net/mycontainer/myfile'

I get this error:

failed to perform copy command due to error: Login Credentials missing. No SAS token or OAuth token is present and the resource is not public

Obviously the AAD service principals are in the role 'Storage Blob Data Contributor' of the storage account.

What is wrong? thanks

CodePudding user response:

The answer to issue 'No SAS token or OAuth token is present' is to run the keyctl session workaround Session. This issue was identified and the keyctl work around can be found here - Azcopy login/logout fails https://github.com/Azure/azure-storage-azcopy/issues/452

  • Related