Share via

Getting authentication error even after providing identity access for authenticating to Azure Redis Cache

Vinod Lokanatha (Harman Connected Services) 65 Reputation points Microsoft External Staff
2026-01-28T10:24:41.7533333+00:00

I have provided user assigned identity with data owner access under redis users, and am using the same identity to call from my web app service.

am still getting access issue error like this -
From logs am able to see token generation is successful

{"traceId":"400018f1-0001-d200-b63f-84710c7967bb","errorCode":"500","errorDetail":"The message timed out in the backlog attempting to send because no connection became available (1000ms) - Last Connection Exception: AuthenticationFailure on virtuoso-mcsredis-buddy.redis.cache.windows.net:6380/Interactive, Flushed/ComputeResult, last: ECHO, origin: SetResult, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 3 of 4 available, last-heartbeat: never, global: 0s ago, v: 2.7.17.27058, command=EXISTS, timeout: 1000, inst: 12, qu: 0, qs: 0, aw: False, bw: CheckingForTimeout, last-in: 0, cur-in: 0, sync-ops: 0, async-ops: 2, serverEndpoint: virtuoso-mcsredis-buddy.redis.cache.windows.net:6380, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 4 of 4 available, clientName: wn1sdwk000YFP(SE.Redis-v2.7.17.27058), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=1021,Min=2,Max=1023), POOL: (Threads=14,QueuedItems=0,CompletedItems=1130,Timers=39), v: 2.7.17.27058 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) ,    at MCSBilledRevenue.Infrastructure.Storage.CacheRepository.GetAsync[T](CacheType cacheType, String key, Func`1 acquire) in D:\\a\\_work\\1\\s\\src\\MCSBilledRevenue.Infrastructure\\Caching\\CacheRepository.cs:line 147\r\n   at MCSBilledRevenue.Core.Services.UserService.GetMetadataAsync() in D:\\a\\_work\\1\\s\\src\\MCSBilledRevenue.Core\\Services\\UserService.cs:line 188\r\n   at MCSBilledRevenue.API.Controllers.UserController.GetMetadataAsync() in /_/src/MCSBilledRevenue.API/Controllers/UserController.cs:line 165\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"} 
Azure Cache for Redis
Azure Cache for Redis

An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.

0 comments No comments

Answer accepted by question author
  1. Manoj Kumar Boyini 12,560 Reputation points Microsoft External Staff Moderator
    2026-01-28T10:58:05.96+00:00

    Hi Vinod Lokanatha (Harman Connected Services),

    Thank you for the update, As you confirmed the issue was not with the Managed Identity or Azure Redis permissions. Token generation was successful, but the problem was in the application code. The existing implementation used IRedisClient, which is not compatible with Azure Redis authentication using Managed Identity.

    The issue was resolved by replacing IRedisClient with IConnectionMultiplexer, after which access worked as expected.

    0 comments No comments

Answer accepted by question author
  1. Q&A Assist
    2026-01-28T10:24:54.49+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It seems you are encountering an authentication error while trying to connect to your Azure Redis Cache using a user-assigned identity. Here are a few steps you can take to troubleshoot the issue:

    1. Verify Identity Access: Ensure that the user-assigned identity has been granted the correct permissions. You mentioned that it has "Data Owner Access Policy"; double-check that this is correctly applied in the Azure portal under the Redis Cache settings.
    2. Token Validation: Since you mentioned that token generation is successful, you might want to validate the token being used for authentication. You can use the PowerShell script provided in the documentation to validate Microsoft Entra ID tokens for Azure Managed Redis Cache resources. This can help identify any issues with the token itself.
    3. Connection Settings: Review your connection settings in the web app. Ensure that you are using the correct endpoint and port (usually 6380 for SSL connections). Also, confirm that your application is set up to use Microsoft Entra ID for authentication.
    4. Timeout Issues: The error message indicates a timeout issue. This could be due to network latency or misconfigured connection settings. Check your network configuration and ensure that your app service can reach the Redis instance.
    5. Client Library: Make sure you are using the correct client library that supports Microsoft Entra ID authentication. The Microsoft.Azure.StackExchangeRedis library is recommended for this purpose. If you haven't done so, install it using the command: cli

    dotnet add package Microsoft.Azure.StackExchangeRedis

    If the problem persists, consider checking the Azure portal for any service health issues or reviewing the logs for more detailed error messages.


    References:

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.