Fix enableAadDataPlane feature flag behavior

This commit is contained in:
Senthamil Sindhu 2024-06-25 15:37:08 -07:00
parent 713df1869a
commit fd3a83dcd8
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ const _global = typeof self === "undefined" ? window : self;
export const tokenProvider = async (requestInfo: Cosmos.RequestInfo) => {
const { verb, resourceId, resourceType, headers } = requestInfo;
if (userContext.features.enableAadDataPlane || (userContext.dataPlaneRbacEnabled && userContext.apiType === "SQL")) {
if (
(userContext.features.enableAadDataPlane && userContext.databaseAccount.properties.disableLocalAuth) ||
(userContext.dataPlaneRbacEnabled && userContext.apiType === "SQL")
) {
if (!userContext.aadToken) {
logConsoleError(
`AAD token does not exist. Please use "Login for Entra ID" prior to performing Entra ID RBAC operations`,