Implement Azure OpenAI keyless authentication with Java

Beginner
Developer
Azure

Learn how Java apps use Microsoft Entra ID, Azure RBAC, DefaultAzureCredential, and managed identities to connect to Azure OpenAI in Microsoft Foundry without API keys.

Learning objectives

After completing this module, you'll be able to:

  • Describe how Microsoft Entra ID and Azure RBAC enable keyless access to Azure OpenAI.
  • Configure an Azure OpenAI RBAC role assignment for least-privileged inference access.
  • Implement local Java authentication with DefaultAzureCredential.
  • Implement Azure-hosted Java authentication with a system-assigned or user-assigned managed identity.

Prerequisites

To get the best learning experience from this module, you should have knowledge and experience of:

  • Basic Java programming.
  • An Azure subscription.
  • An Azure OpenAI resource in Microsoft Foundry with a model deployment.
  • Java Development Kit and Maven installed.
  • Azure CLI installed and signed in.
  • Basic familiarity with Azure RBAC and managed identities.

Get started with Azure

Choose the Azure account that's right for you. Pay as you go or try Azure free for up to 30 days. Sign up.