-
Notifications
You must be signed in to change notification settings - Fork 2.1k
App Config - Audience policy #47224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
App Config - Audience policy #47224
Conversation
There was a problem hiding this 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
AudiencePolicyclass that implementsHttpPipelinePolicyto 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 |
...pconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
Outdated
Show resolved
Hide resolved
...pconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
Outdated
Show resolved
Hide resolved
...uration/src/test/java/com/azure/data/appconfiguration/implementation/AudiencePolicyTest.java
Show resolved
Hide resolved
...nfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AudiencePolicy.java
Show resolved
Hide resolved
…/com/azure/data/appconfiguration/ConfigurationClientBuilder.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
Adds an Audience Policy to give a better error message on Audience failures in clouds such as Bleu.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines