Skip to content

Use AADAudience connection string value when present #2966

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wired010
Copy link
Member

Fix Issue # .

Changes

When a connection string is provided, and it includes an AADAudience component, use that value to build a scope used when fetching tokens. If no AADAudience is available, default to the commercial value to maintain current behavior in commercial/public cloud.

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

When a connection string is provided, and it includes an AADAudience
component, use that value to build a scope used when fetching tokens. If
no AADAudience is available, default to the commercial value to maintain
current behavior in commercial/public cloud.
- Added line to CHANGELOG describing update
- Removed audience/scope values from AuthConstants as they are no longer
  used. Modified tests accordingly.
@wired010 wired010 changed the title Use AADAudience connection string value wjhen present Use AADAudience connection string value when present Mar 21, 2025
@wired010 wired010 marked this pull request as ready for review March 21, 2025 16:08
@pharring
Copy link
Member

pharring commented Mar 24, 2025

The scopes for Azure Monitor used to have double-slashes in them:
https://monitor.azure.com//.default
https://monitor.azure.us//.default
etc.
@TimothyMothra, did we change that? I notice the docs no longer have the trailing slash.

Move back to a scope of https://monitor.azure...//.default, to generate
a token with an audience of https://monitor.azure.../ (includes a
trailing slash).
@wired010
Copy link
Member Author

Reverted the scope building logic to generate scopes such as https://monitor.azure.com//.default and https://monitor.azure.us//.default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants