How to fix: azure identity (defaultAzureCredential())

Maarten van Dun 20 Reputation points
2025-08-06T13:31:02.1533333+00:00

When running my application locally.
I use the function DefaultAzureCredential().
When i start my application i get these logs:
2025-08-06 15:11:58,055 - src.utils.startup - INFO - Starting application initialization...

2025-08-06 15:11:58,055 - src.utils.startup - INFO - Creating Azure AI client...

2025-08-06 15:11:58,057 - azure.identity.aio._credentials.environment - INFO - No environment configuration found.

2025-08-06 15:11:58,077 - azure.identity.aio._credentials.managed_identity - INFO - ManagedIdentityCredential will use Azure Arc managed identity

2025-08-06 15:11:58,084 - src.utils.startup - INFO - Azure AI client created successfully

On my pc i 'use Azrue Arc managed identity'. On my colleagues pc it doesn't mention Arc at all (what is was before on my pc also)

when i use the function: AzureCliCredential() It works locally but this is ofc not ready to be deployed.
What could be the issue here? Is it something with my pc? Something wrong with the default function?

Azure Arc
Azure Arc
A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
{count} votes

Accepted answer
  1. TP 131.6K Reputation points Volunteer Moderator
    2025-08-06T14:56:04.82+00:00

    Hi Maarten,

    Is your local PC onboarded to Azure Arc? If you navigate to Azure portal -- Azure Arc -- Azure Arc resources -- Machines, is it listed? You can use link below to get there:

    https://portal.azure.com/#view/Microsoft_Azure_ArcCenterUX/ArcCenterMenuBlade/~/servers

    What is your local development environment? Windows/Linux, Visual Studio or VSCode or NeoVIM or other, etc.

    In terms of Identity, a machine joined to Azure Arc can use managed identity to authenticate. For example, a VM in AWS could have managed identity and code running on it could authenticate to Azure to call REST APIs. Same thing for on-premises physical server or VM.

    On related note, for development under Visual Studio it has concept of "Developer account" which is method for authenticating to Azure when testing code locally. Yet another method is using service principals.

    As you can see there are many potential options for configuring how it will authenticate when your code uses DefaultAzureCredential().

    Are you experiencing issue or are you just wondering why your PC is behaving differently than your colleague's? Assuming the agent for Azure Arc is on your PC you could remove it if that is what you prefer.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.