Error with azcopy, getting error failed to perform copy command due to error: no cached token found, please log in with azcopy's login command, required key not available

Nikhil Purva 6 Reputation points
2022-07-14T04:43:24.83+00:00

Hi Team,
We are facing an issue with azcopy when using in a container to copy data in a blob storage. For login we are using AZCOPY_AUTO_LOGIN_TYPE, AZCOPY_SPA_APPLICATION_ID, AZCOPY_SPA_CLIENT_SECRET and AZCOPY_TENANT_ID environment variable. When hard coding the variables like:
export AZCOPY_AUTO_LOGIN_TYPE=SPN
export AZCOPY_SPA_APPLICATION_ID=*******
export AZCOPY_SPA_CLIENT_SECRET=********
export AZCOPY_TENANT_ID=*********

azcopy copy test2.txt 'https://*****.blob.core.windows.net/******'

then the azcopy is working fine and when we are just making these variable available in the container with their values then it is giving below error message:

Error: "failed to perform copy command due to error: no cached token found, please log in with azcopy's login command, required key not available"

We have tried with keyctl session as well but no luck and below are the articles from where we tried to resolve this issue.

https://github.com/Azure/azure-storage-azcopy/issues/452
https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory#authorize-a-service-principal-by-using-a-client-secret-1

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,275 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 42,516 Reputation points Microsoft Employee
    2022-07-31T11:49:59.787+00:00

    @Nikhil Purva

    Unfortunately, when auto-login fails there's a bit of poor UX behind it. Automatic login failure is non-descript when no other auth is present · Issue #1753 · Azure/azure-storage-azcopy (github.com) I would recommend trying with a normal azcopy login to see what the issue might be with your login attempt.

    Please let us know if you have any further queries. I would like to work closer on this issue

    ----------

    Please do not forget to 226504-screenshot-2021-12-10-121802.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments