Which version of the AzCopy was used?
AzCopy version: 10.31.0
Azure CLI version: 2.81.0
Which platform are you using? (ex: Windows, Mac, Linux)
WSL Ubuntu 24.04.3 LTS
What command did you run?
azcopy login
(using device code authentication)
What problem was encountered?
AzCopy reported that my account was “locked” during device code authentication, even though I could successfully sign in to the Azure Portal with the same account. The error message was misleading — the actual issue was that AzCopy was authenticating against the wrong Azure AD tenant. Once I specified the correct tenant ID manually, authentication succeeded.
How can we reproduce the problem in the simplest way?
- Use an Azure AD account that belongs to multiple tenants.
- Run
azcopy login without specifying a tenant ID.
- Complete the device code authentication in the browser.
- AzCopy returns an “account is locked” error even though the account is not locked and portal login works normally.
Have you found a mitigation/solution?
Yes. Running azcopy login --tenant-id <tenant-guid> resolves the issue immediately. A clearer error message suggesting this would help users diagnose the problem more easily.