Skip to content

Conversation

@mrm9084
Copy link
Member

@mrm9084 mrm9084 commented Nov 10, 2025

Description

Adds an Audience Policy to give a better error message on Audience failures in clouds such as Bleu.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings November 10, 2025 22:09
@mrm9084 mrm9084 requested a review from a team as a code owner November 10, 2025 22:09
@github-actions github-actions bot added the App Configuration Azure.ApplicationModel.Configuration label Nov 10, 2025
@mrm9084 mrm9084 requested a review from a team as a code owner November 10, 2025 22:13
Copilot finished reviewing on behalf of mrm9084 November 10, 2025 22:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an AudiencePolicy to the Azure App Configuration SDK for Java to provide more user-friendly error messages when Azure Active Directory audience-related authentication failures occur, particularly in non-public Azure clouds (such as Azure China or Azure Government). The policy intercepts HTTP responses containing the AAD error code "AADSTS500011" and replaces the error message with clearer guidance based on whether an audience was configured or not.

Key Changes

  • Added AudiencePolicy class that implements HttpPipelinePolicy to detect and transform audience-related authentication errors
  • Integrated the policy into the HTTP pipeline in ConfigurationClientBuilder
  • Added comprehensive unit tests covering both sync and async scenarios
  • Updated CHANGELOG to document the new feature

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

File Description
sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AudiencePolicy.java New policy class that intercepts AAD audience errors and provides clearer error messages based on whether an audience was configured
sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java Integrates AudiencePolicy into the HTTP pipeline before retry policies
sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/implementation/AudiencePolicyTest.java Comprehensive test coverage for the new policy including sync/async scenarios, error transformation, and edge cases
sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md Documents the new audience policy feature for better error messaging

…/com/azure/data/appconfiguration/ConfigurationClientBuilder.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App Configuration Azure.ApplicationModel.Configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants