hundreds-rainbow-68836
11/14/2025, 7:12 AMtall-airline-16756
11/14/2025, 7:12 AMtall-airline-16756
11/14/2025, 7:13 AMazure_ad_token and azure_ad_token_provider when it comes to Azure Active Directory (AAD) authentication:
• azure_ad_token: This is where you provide a pre-acquired Azure Active Directory token as a string. It’s used directly for authentication with Azure OpenAI services, and if you don’t provide it explicitly, it can be automatically picked up from the environment variable AZURE_OPENAI_AD_TOKEN. Pretty handy!
• azure_ad_token_provider: This one is a bit more dynamic. It accepts a callable (specifically, an AsyncAzureADTokenProvider) that fetches an AAD token whenever it’s needed. This is great for more advanced scenarios, like when tokens need to be refreshed or retrieved asynchronously, such as with managed identity or service principal flows.
So, to sum it up: azure_ad_token is a static token string you provide upfront, while azure_ad_token_provider offers a flexible, programmatic way to get tokens on the fly for Azure authentication. I hope this helps clear things up! If you have any more questions, feel free to ask.
Sources: Azure OpenAI TTS plugin guide | LiveKit Docs | Azure OpenAI STT plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real...