Skip to content
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

AAD and LocalAuthentication should not be mutually exclusive. #2795

Open
zyofeng opened this issue Jun 26, 2023 · 4 comments
Open

AAD and LocalAuthentication should not be mutually exclusive. #2795

zyofeng opened this issue Jun 26, 2023 · 4 comments
Labels

Comments

@zyofeng
Copy link

zyofeng commented Jun 26, 2023

Currently if SetAzureTokenCredential is called, then TelemetryClient will include a bearer token when calling AI /v2.1/track endpoint, and even if local authentication is still enabled the endpoint will return 403 unless Metrics publisher role is granted.

This makes it harder to migrate existing apps to AAD because switching from local auth to AAD requires a code change/deployment using SetAzureTokenCredential on top of adding the roles in Azure.

Ideally something similar to Microsoft.Data.SqlClient where we can specify authentication method in the Connectionstring like this and avoid code change that would be great.
InstrumentationKey=xxxxxx-xxxx-xxx-xxx-xxxxxxx;IngestionEndpoint=https://xxxxxxxx.in.applicationinsights.azure.com/;LiveEndpoint=https://xxxxxx.livediagnostics.monitor.azure.com/;**Authentication=Active Directory Default**;

Alternatively if we can make local authentication work despite calling SetAzureTokenCredential.

@zyofeng zyofeng added the bug label Jun 26, 2023
@Piedone
Copy link

Piedone commented Aug 6, 2024

Where do you see a bearer token being included in the /track request? I'm debugging a 401 with that, getting it when I disable local auth, despite calling SetAzureTokenCredential and having a Managed Identity properly set up with the Monitoring Metrics Publisher role (and server-side tracking, as well as the Live Metrics control channel, work).

@Piedone
Copy link

Piedone commented Aug 6, 2024

I've opened an issue about this: #2893.

@zyofeng
Copy link
Author

zyofeng commented Aug 7, 2024

Where do you see a bearer token being included in the /track request? I'm debugging a 401 with that, getting it when I disable local auth, despite calling SetAzureTokenCredential and having a Managed Identity properly set up with the Monitoring Metrics Publisher role (and server-side tracking, as well as the Live Metrics control channel, work).

Im using wireshark to inspect the call from a .net console app.

@Piedone
Copy link

Piedone commented Aug 7, 2024

Ah OK, so you're not doing JavaScript client-side tracking. That makes sense, not sure why I thought that. Thanks!

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

No branches or pull requests

2 participants