fix: update getAzureIdentityAuthProvider and make tenant id and client id optional.

This commit is contained in:
2026-03-10 20:28:41 +01:00
parent 97f7011f97
commit 059fc3c1da

View File

@@ -32,14 +32,15 @@ export function getMsalAuthProvider(
}; };
} }
export function getAzureIdentityAuthProvider( export function getAzureIdentityAuthProvider(tenantId?: string, clientId?: string) : GraphAuthProvider {
tenantId: string, const credentialOptions =
clientId: string, tenantId && clientId
) { ? { tenantId, managedIdentityClientId: clientId }
const credential = new DefaultAzureCredential({ : undefined;
tenantId,
managedIdentityClientId: clientId, const credential = credentialOptions
}); ? new DefaultAzureCredential(credentialOptions)
: new DefaultAzureCredential();
const getBearerToken = getBearerTokenProvider( const getBearerToken = getBearerTokenProvider(
credential, credential,