Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.25k stars 4.59k forks source link

AZURE_REGIONAL_AUTHORITY_NAME not working for AAD regional endPOINT work (ESTS-R) #45411

Closed shivamverma-ms closed 6 days ago

shivamverma-ms commented 1 month ago

Library name and version

Azure.Identity

Query/Question

Hi, for ESTS-R

I added the Environment variable "AZURE_REGIONAL_AUTHORITY_NAME" to an incorrect random name, but it's not working as aad calls are still taking place but instead they should be failing with Unknown host error. Meanwhile for other services under the tenant i am using are able to make it work with below changes only.

Package References: "Azure.Identity" -> Version="1.11.4" "Microsoft.Identity.ServiceEssentials.AspNetCore" -> Version="1.26.0" "Microsoft.IdentityModel.S2S.Extensions.AspNetCore" -> Version="4.5.0"

Something Like this:

Environment.GetEnvironmentVariable("AZURE_REGIONAL_AUTHORITY_NAME"); // this returns "xyz" which is an incorrect endpoint.
// even with incorrect endpoint the below call is passing through.
var creds = new ClientCertificateCredential(
    clientApp.TenantId,
    clientApp.ClientId,
    cert,
    new ClientCertificateCredentialOptions
    {
        SendCertificateChain = true,
        AuthorityHost = new Uri(aadSettings.AadAuthority),
    });

Environment

No response

github-actions[bot] commented 1 month ago

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

christothes commented 3 weeks ago

Hi @shivamverma-ms - Could you clarify what you are trying to do in the successful case?

AZURE_REGIONAL_AUTHORITY_NAME is meant to control the azure region selection for 1st party applications only.

The AuthorityHost option sets the specific host to use for the authority.

Which are you trying to use and what problem do you encounter when you attempt to use them?

github-actions[bot] commented 3 weeks ago

Hi @shivamverma-ms. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] commented 2 weeks ago

Hi @shivamverma-ms, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!