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

[BUG] VisualStudioCredential error AADSTS65002 connecting to Azure Monitor Control Service #44107

Closed
serge-rsvz-inasti opened this issue May 17, 2024 · 6 comments
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@serge-rsvz-inasti
Copy link

Library name and version

Azure.Identity 1.11.3

Describe the bug

An error occurs when attempting to authenticate using VisualStudioCredential credentials. The error message indicates a consent issue between the first-party application and resource, requiring preauthorization. (VisualStudioCredential with Azure Monitor Control Service)

Expected behavior

The application should successfully authenticate using the credentials.

Actual behavior

The application fails to authenticate, and the following error message is displayed: AADSTS65002: Consent between first party application '04f0c124-f2bc-4f59-8241-bf6df9866bbd' and first party resource 'e933bd07-d2ee-4f1d-933c-3752b819567b' must be configured via preauthorization.

Reproduction Steps

Create a new .Net (8) Web API and add application inishgt as such:

        builder.Services.Configure<TelemetryConfiguration>(config =>
        {
            config.SetAzureTokenCredential(new VisualStudioCredential());
        });
        builder.Services.AddApplicationInsightsTelemetry(options =>
        {
            options.ConnectionString = connectionString;
        });

Run the API and access some page.

Environment

Azure Subscription offer: Enterprise Dev/Test
Visual Studio Enterprise 17.9.7

@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 17, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@serge-rsvz-inasti
Copy link
Author

serge-rsvz-inasti commented May 17, 2024

TIPS to observe the issue:

Replace VisualStudioCredential by your own inheriting implementation, and observe the behaviour of AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken)

internal class VisualStudioCredentialX : VisualStudioCredential
{
    public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken)
    {
        return base.GetToken(requestContext, cancellationToken);
    }
}

image

@christothes
Copy link
Member

hi @serge-rsvz-inasti
This is something that Visual Studio can resolve via updating its first party pre-authorizations. Please report this via the instructions mentioned here and include the details of the AADSTS65002 error via the reporting link mentioned in the link above.

@christothes christothes added the issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. label May 17, 2024
@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label May 17, 2024
Copy link

Hi @serge-rsvz-inasti. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@serge-rsvz-inasti
Copy link
Author

hi @serge-rsvz-inasti This is something that Visual Studio can resolve via updating its first party pre-authorizations. Please report this via the instructions mentioned here and include the details of the AADSTS65002 error via the reporting link mentioned in the link above.

This approach has not worked so far.

It’s worth noting that the credentials are working fine for KeyVault, and the Azure Subscription offer is Enterprise Dev/Test.

My hypothesis is that Azure Monitor Control Service might not recognize Visual Studio as a preauthorized application under the Enterprise Dev/Test offer.

Copy link

Hi @serge-rsvz-inasti, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Development

No branches or pull requests

2 participants