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
addAadSupportInSpark #32393
addAadSupportInSpark #32393
Conversation
...smos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosCatalogBase.scala
Show resolved
Hide resolved
API change check API changes are not detected in this pull request. |
...smos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosCatalogBase.scala
Outdated
Show resolved
Hide resolved
...e-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/cosmosclient/ICosmosClient.scala
Outdated
Show resolved
Hide resolved
...e-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/cosmosclient/ICosmosClient.scala
Outdated
Show resolved
Hide resolved
...e-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/cosmosclient/ICosmosClient.scala
Outdated
Show resolved
Hide resolved
5bb9fd1
to
3855036
Compare
86cf08e
to
205be9c
Compare
...smos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosClientCache.scala
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosConfig.scala
Show resolved
Hide resolved
c6da9af
to
482440c
Compare
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
LGTM - thanks! |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @xinlian12 , I've created a PR to bump the version. PR's merged. It should be fixed. |
Description
Add aad support in spark.
Why the need
You cannot use any Azure Cosmos DB data plane SDK to authenticate management operations with an Azure AD identity.
Azure Cosmos DB RBAC
Design
Cosmos Config
New config entry has been introduced which allows customer to provide service principle related config
spark.cosmos.auth.type
spark.cosmos.account.subscriptionId
spark.cosmos.account.tenantId
spark.cosmos.account.resourceGroupName
spark.cosmos.account.azureEnvironment
spark.cosmos.auth.aad.clientId
spark.cosmos.auth.aad.clientSecret
Spark catalog
Catalog is the API interfaces which allows customer to interact with the metadata store.
CosmosCatalogBase
andCosmosCatalog
contain all the related implementations, which includes most of the related management operations (like creating database, creating container etc). The idea here is to use ManagementSDK for the underlying operations if customer is using ServicePrinciple based AAD authentication, use CosmosDB Java SDK V4 if customer is using masterKey authentication.Throughput control
Query database/container throughput throughput AAD authentication is also not supported through Cosmos DB data plane SDK currently, so in order for throughput control to work correctly, it needs a way to query throughput successfully.
A new internal method is being introduced which accept a throughputQueryMono, which will be used in
ThroughputContainerController
.Test
Currently spark CI pipeline only targets CosmosDB Emulator, however using CosmosDB Emulator for testing is challenging as:
So the following tests is used as gates:
basicScenarioAad
notebook which can be triggered through /azp run java - cosmos - sparkCosmosClientCacheITest
,CosmosCatalogITest