Azure / azure-storage-azcopy

The new Azure Storage data transfer utility - AzCopy v10
MIT License
602 stars 217 forks source link

WSL support for azcopy #2646

Open joshuafernandes opened 5 months ago

joshuafernandes commented 5 months ago

Which version of the AzCopy was used?

Note: The version is visible when running AzCopy without any argument

azcopy version 10.24.0

Which platform are you using? (ex: Windows, Mac, Linux)

Windows 11 with WSL (ubuntu 22.04)

What command did you run?

Note: Please remove the SAS to avoid exposing your credentials. If you cannot remember the exact command, please retrieve it from the beginning of the log file.

export AZCOPY_AUTO_LOGIN_TYPE=DEVICE azcopy list "https://.blob.core.windows.net" To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code P..... to authenticate.

INFO: Logging in under the "Common" tenant. This will log the account in under its home tenant. INFO: If you plan to use AzCopy with a B2B account (where the account's home tenant is separate from the tenant of the target storage account), please sign in under the target tenant with --tenant-id INFO: Login succeeded. INFO: Authenticating to source using Azure AD

What problem was encountered?

Azcopy doesn't work at all on wsl, have attemped the autologin as per https://github.com/Azure/azure-storage-azcopy/wiki/Improved-login-support-for-AzCopy-commands-(with-in-memory-secret-store). Have attempted the keyctl workaround. It gets past the login and just stalls

How can we reproduce the problem in the simplest way?

  1. Win11 with WSL
  2. Install azcopy
  3. Attempt to list a storageaccount, or write to it

Have you found a mitigation/solution?

Nope, none appear to exist

siminsavani-msft commented 5 months ago

Hi @joshuafernandes ! I was able to reproduce your issue. Could you please try using SAS to complete your job while we investigate this further?

dironco-industries commented 4 months ago

Hi @joshuafernandes ! I was able to reproduce your issue. Could you please try using SAS to complete your job while we investigate this further?

I expand this problem, It's not just from WSL in Win11, azcopy using "Microsoft Entra" login, it doesn't work from any Linux machine. You should always use SAS.

gabe-microsoft commented 3 months ago

This is unfortunately a very old bug. See #1922 and #2274.

However, I recently discovered a workaround if you use the Azure CLI as well.

# Configure AzCopy to auto-login using Azure CLI.
export AZCOPY_AUTO_LOGIN_TYPE=AZCLI

# Login using Azure CLI (if not logged in already).
az login

# Run any AzCopy command.
azcopy copy https://mysa.blob.core.windows.net/mycontainer/myblob .