-
Notifications
You must be signed in to change notification settings - Fork 794
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
ImdsManagedIdentityOAuthProvider should send resource ID instead of OIDC scope #4096
Comments
Is it possible the error is the result of a permissions restriction in your environment, the use of .default works in my test environment |
@tustvold But the documentation clearly says that a value of Managed Identity credential class in Azure Java SDK accepts resource ID as configuration parameter. And an equivalent class in Azure Python SDK explicitly drops https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/azure/identity/_internal/managed_identity_client.py#L112 |
I'd like to share my researches in case it helps. How I reached that conclusion. First, what is the definition of a scope
Scope examples:
Sources: What is the
|
Thank you for your investigation, this makes sense to me and I would be happy to review a fix. |
|
Describe the bug
The current implementation of
ImdsManagedIdentityOAuthProvider
(for MSI-based authentication in Azure) tries to get tokens from IMDS endpoint by using the default OIDC scope (resource ID+permission) of Azure storage service (https://storage.azure.com/.default
) as query parameterresource
.https://github.com/apache/arrow-rs/blob/master/object_store/src/azure/credential.rs#L53
https://github.com/apache/arrow-rs/blob/master/object_store/src/azure/credential.rs#L418-L428
However, the value of
resource
must be a resource ID (https://storage.azure.com/
) without.default
. You can find a C# code example in the following official document.https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-vm-windows-access-storage#access-data
To Reproduce
Sorry. I cannot directly reproduce this problem since I have no experience in Rust. We identified this problem when we tried to write Delta Lake file by using Python binding of delta-rs which uses Rust
object_store
.An important part in this error message is the following:
We can reproduce the same error by sending requests to IMDS endpoint.
Expected behavior
ImdsManagedIdentityOAuthProvider sends request to
http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&...&resource=https%3A%2F%2Fstorage.azure.com%2F
, without.default
in query parameterresource
.The text was updated successfully, but these errors were encountered: