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

DefaultAzureCredential Managed Identity Behavior Inconsistent w/ other Azure services. #8037

Closed
cmeyertons opened this issue Jan 6, 2022 · 2 comments
Assignees

Comments

@cmeyertons
Copy link

Authenticating to other Azure services w/ a DefaultAzureCredential and one user-assigned Managed Identity (system-assigned turned off) results in a 400 bad request.

If the same setup runs on an Azure VM, the DefaultAzureCredential intelligently leverages the only Managed Identity assigned (the single user-assigned).

Repro steps

Provide the steps required to reproduce the problem:

  1. Create a function app.
  2. Assign one user-assigned managed identity
  3. Disable the system-assigned managed identity
  4. Run code to connect to another Azure Service (e.g. Azure App Config) using a DefaultAzureCredential

Expected behavior

The request should be successfully authenticated using the single user-assigned Managed Identity.

Actual behavior

Resulting call fails w/ a 400 bad request

Known workarounds

Supplying the env variable AZURE_CLIENT_ID alleviates this issue. This is undesirable because it is yet another thing to keep track of when the default convention works elsewhere in Azure (e.g. Azure VMs)

Related information

https://stackoverflow.com/questions/68954854/defaultazurecredential-doesnt-work-with-user-assigned-managed-identity-in-azure
Azure/Azure-Functions#2100

Provide any related information

This is related to the .NET Azure.Identity behavior.

@ghost ghost assigned liliankasem Jan 6, 2022
@v-bbalaiagar v-bbalaiagar self-assigned this Jan 11, 2022
@v-bbalaiagar
Copy link

Hi @mattchenderson, Could you please look at this issue here.

@mattchenderson
Copy link
Contributor

The service behavior is as expected. The requirement to specify the user-assigned identity and not assume it was intentional, and I'm not sure how the behavior drift came up. I'll follow up with the teams involved to understand that a bit better and see what can be done. But for now, I would say there are no active plans to start defaulting the user-assigned identity, and it must be defined explicitly when requesting the token in App Service and Azure Functions.

@liliankasem liliankasem closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants