Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AZCOPY_AUTO_LOGIN_TYPE="AZCLI" fails with "Tenant shouldn't be specified for managed identity account" #2794

Open
ohads-MSFT opened this issue Aug 27, 2024 · 4 comments
Assignees
Labels

Comments

@ohads-MSFT
Copy link

Which version of the AzCopy was used?

10.26.0

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

Linux

What command did you run?

# In an ACI container with an associated USer-Assigned identity
$env:AZCOPY_AUTO_LOGIN_TYPE = "AZCLI"
az login --identity
azcopy copy "https://[account].blob.core.windows.net/[container]/[path/to/blob]?[SAS]" "https://[account].blob.core.windows.net/[container]/[path/to/blob]"

What problem was encountered?

Failed to perform Auto-login: AzureCLICredential: ERROR: Tenant shouldn't be specified for managed identity account

How can we reproduce the problem in the simplest way?

Run the command as above

Have you found a mitigation/solution?

Switched to AZCOPY_AUTO_LOGIN_TYPE="MSI" (which then failed on something else, see #2792)

Output

INFO: Scanning...

Log file

2024/08/26 16:12:19 AzcopyVersion 10.26.0
2024/08/26 16:12:19 OS-Environment linux
2024/08/26 16:12:19 OS-Architecture amd64
2024/08/26 16:12:19 Log times are in UTC. Local time is 26 Aug 2024 16:12:19
2024/08/26 16:12:21 Closing Log
2024/08/26 16:12:18 AzcopyVersion 10.26.0
2024/08/26 16:12:18 OS-Environment linux
2024/08/26 16:12:18 OS-Architecture amd64
2024/08/26 16:12:18 Log times are in UTC. Local time is 26 Aug 2024 16:12:18
2024/08/26 16:12:19 ISO 8601 START TIME: to copy files that changed before or after this job started, use the parameter --include-before=2024-08-26T16:12:13Z or --include-after=2024-08-26T16:12:13Z

@vibhansa-msft
Copy link
Member

Kindly share output of "azcopy env" as well.

@adreed-msft
Copy link
Member

Just chiming in, this looks wrong:

# In an ACI container with an associated USer-Assigned identity
$env:AZCOPY_AUTO_LOGIN_TYPE = "AZCLI"
az login --identity
azcopy copy "https://[account].blob.core.windows.net/[container]/[path/to/blob]?[SAS]" "https://[account].blob.core.windows.net/[container]/[path/to/blob]"

--identity refers to MSI, but $env:AZCOPY_AUTO_LOGIN_TYPE is a completely different type of auth, and the latter here means azcopy login is unnecessary.

@ohads-MSFT
Copy link
Author

ohads-MSFT commented Aug 28, 2024

Just chiming in, this looks wrong:

# In an ACI container with an associated USer-Assigned identity
$env:AZCOPY_AUTO_LOGIN_TYPE = "AZCLI"
az login --identity
azcopy copy "https://[account].blob.core.windows.net/[container]/[path/to/blob]?[SAS]" "https://[account].blob.core.windows.net/[container]/[path/to/blob]"

--identity refers to MSI, but $env:AZCOPY_AUTO_LOGIN_TYPE is a completely different type of auth, and the latter here means azcopy login is unnecessary.

That snippet is just a minimal repro, in my actual script I need az login for unrelated reasons. Then I set $env:AZCOPY_AUTO_LOGIN_TYPE = "AZCLI" so that azcopy can use the token acquired by az, rather than needlessly asking for another one.

@ohads-MSFT
Copy link
Author

Kindly share output of "azcopy env" as well.

I already switched to MSI auth, I'll see if I get the time to revert and check, but may I suggest you add this requirement to the "new issue" template?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
@adreed-msft @vibhansa-msft @ohads-MSFT @dphulkar-msft and others