test
import com.azure.identity.DefaultAzureCredential; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.core.credential.TokenCredential; import com.azure.core.util.Configuration; public class AzureAccessTokenExample { public static void main(String[] args) { try { // Load Azure App Configuration Configuration configuration = Configuration.getGlobalConfiguration(); // Set the Azure AD authority host (optional, can be omitted for default) String azureAuthorityHost = configuration.get("AZURE_AUTHORITY_HOST"); // Create a DefaultAzureCredential using the Azure Identity library TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(azureAuthorityHost) // Optional: Set the authority host .build(); // Specify the scope (optional, can be omitted for default) String scope = "ht