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_MSI_RESOURCE_STRING does not work with MSAL #2395

Closed
wanzhuM opened this issue Oct 2, 2023 · 5 comments
Closed

AZCOPY_MSI_RESOURCE_STRING does not work with MSAL #2395

wanzhuM opened this issue Oct 2, 2023 · 5 comments

Comments

@wanzhuM
Copy link

wanzhuM commented Oct 2, 2023

Which version of the AzCopy was used?

v10.21.0

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

Linux (specifically shell extension in ev2)

What command did you run?

export AZCOPY_AUTO_LOGIN_TYPE=MSI
export AZCOPY_MSI_RESOURCE_STRING="$resourceId"
azcopy sync "$src" "$dst" --recursive --delete-destination=true

What problem was encountered?

2023-10-01 09:58:19.345119: Failed to perform Auto-login: ManagedIdentityCredential authentication failed
2023-10-01 09:58:19.345131: GET http://169.254.169.254/metadata/identity/oauth2/token
2023-10-01 09:58:19.345144: --------------------------------------------------------------------------------
2023-10-01 09:58:19.345156: RESPONSE 400 Bad Request
2023-10-01 09:58:19.345168: --------------------------------------------------------------------------------
2023-10-01 09:58:19.345180: Failed to make request: '\''Identity not found: '\''ACI_MI_DEFAULT'\'''\''
2023-10-01 09:58:19.345192: 
2023-10-01 09:58:19.345204: --------------------------------------------------------------------------------
2023-10-01 09:58:19.345215: To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#managed-id.'

How can we reproduce the problem in the simplest way?

Use any bash shell with User assigned managed identity, in my case it was in ev2

Have you found a mitigation/solution?

Use client ID instead of resource string

export AZCOPY_MSI_CLIENT_ID="$clientId"
@diodfr
Copy link

diodfr commented Oct 3, 2023

The option has been deprecated :
https://github.com/Azure/azure-storage-azcopy/releases/tag/v10.21.0-Preview

  1. Deprecated support for object IDs in MSI. Client ID or Resource ID can be used as an alternative.

@wanzhuM
Copy link
Author

wanzhuM commented Oct 3, 2023

The option has been deprecated : https://github.com/Azure/azure-storage-azcopy/releases/tag/v10.21.0-Preview

  1. Deprecated support for object IDs in MSI. Client ID or Resource ID can be used as an alternative.

This doesn't make any sense, quoting from the official docs: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json

We were originally using "RESOURCE_STRING" not "OBJECT_ID"

RESOURCE_STRING, which I'm assiming is Resource ID should work and used to.

Example:

export AZCOPY_MSI_RESOURCE_STRING=/subscriptions/<subId>/resourceGroups/<rg>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identityName>

@diodfr
Copy link

diodfr commented Oct 3, 2023

Please forgive me, I misread your issue.
I thought that you use the deprecated system variable.
In fact, I have the same issue #2398 but azcopy uses the system identity as fallback instead of the provided resource string.

@gapra-msft
Copy link
Member

Hi, I believe this issue was fixed by the following PR #2406

This should be released as part of our 10.22 release

@gapra-msft
Copy link
Member

The 10.22.0 version was just released. Closing this issue as a result.

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

No branches or pull requests

3 participants