This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.25k
stars
1.93k
forks
source link
[QUERY] Unable to use Managed Identity to connect Cosmos DB using Spark Cosmos OLTP connector #40604
Query/Question
We are using Spark Cosmos DB OLTP connector to connect Cosmos DB from HDInsights. We are trying to connect using Managed Identity. As per the documentation followed, we are using supported connector and have set necessary configs in the spark config. However, we are getting this error.
Caused by: azure_cosmos_spark.com.microsoft.aad.msal4j.MsalAzureSDKException: java.util.concurrent.ExecutionException: azure_cosmos_spark.com.azure.identity.CredentialUnavailableException: ManagedIdentityCredential authentication unavailable. Connection to IMDS endpoint cannot be established. at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByAppProviderSupplier.fetchTokenUsingAppTokenProvider(AcquireTokenByAppProviderSupplier.java:79) at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByAppProviderSupplier.execute(AcquireTokenByAppProviderSupplier.java:56) at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByClientCredentialSupplier.acquireTokenByClientCredential(AcquireTokenByClientCredentialSupplier.java:78) at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByClientCredentialSupplier.execute(AcquireTokenByClientCredentialSupplier.java:49) at azure_cosmos_spark.com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:69) at azure_cosmos_spark.com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:18) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Query/Question We are using Spark Cosmos DB OLTP connector to connect Cosmos DB from HDInsights. We are trying to connect using Managed Identity. As per the documentation followed, we are using supported connector and have set necessary configs in the spark config. However, we are getting this error.
Caused by: azure_cosmos_spark.com.microsoft.aad.msal4j.MsalAzureSDKException: java.util.concurrent.ExecutionException: azure_cosmos_spark.com.azure.identity.CredentialUnavailableException: ManagedIdentityCredential authentication unavailable. Connection to IMDS endpoint cannot be established. at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByAppProviderSupplier.fetchTokenUsingAppTokenProvider(AcquireTokenByAppProviderSupplier.java:79) at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByAppProviderSupplier.execute(AcquireTokenByAppProviderSupplier.java:56) at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByClientCredentialSupplier.acquireTokenByClientCredential(AcquireTokenByClientCredentialSupplier.java:78) at azure_cosmos_spark.com.microsoft.aad.msal4j.AcquireTokenByClientCredentialSupplier.execute(AcquireTokenByClientCredentialSupplier.java:49) at azure_cosmos_spark.com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:69) at azure_cosmos_spark.com.microsoft.aad.msal4j.AuthenticationResultSupplier.get(AuthenticationResultSupplier.java:18) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
We would like to understand if there are any missing configs. Why is this not a Bug or a feature Request? We followed required documentation. https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos-spark_3_2-12/docs/configuration-reference.md#aad-auth-config
Setup (please complete the following information if applicable):
Library/Libraries: com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12:4.31.0
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report