Share via

How to fix 'DefaultAzureCredentials failed to retrieve token' error in function app

David Shepherd 50 Reputation points
2025-05-27T08:33:12.2933333+00:00

I deployed a function app which is authenticated via DefaultAzureCredentials. However,image

I need help to fix the function app error message that is shown in the above image.****

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author

RChotu 3,210 Reputation points Microsoft External Staff Moderator
2025-05-28T08:26:25.34+00:00

Hi @David Shepherd,

The error states that, the default credential is unable to generate a token.

Make sure that you have enabled managed identity and given the correct role to the resource as below:

image


If this answer was helpful, please click "Accept the answer" and mark Yes, as this can help other community members.

enter image description here

If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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