How can I connect to Azure cache for Redis using managed identity from c#

Harika Gumudavally 0 Reputation points Microsoft Employee
2023-07-14T02:33:09.5733333+00:00

Hi,

I have created system assigned managed identity for an App Service and Azure VM. In the current approach, I have connection strings that are used to connect to Azure Cache for Redis from my application. I need to override it with managed identity now.

How do I pass the managed identity information to the Connection Multiplexer of StackExchange Redis.

Azure Cache for Redis
Azure Cache for Redis

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


1 answer

Sort by: Most helpful
  1. SSingh-MSFT 16,461 Reputation points Moderator
    2023-07-17T03:50:22.5066667+00:00

    Hi
    Harika Gumudavally
    •,

    Thanks for your patience.

    Please refer to the sample code which demonstrate how to connect to your Azure Cache for Redis instance using an Azure AD token: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis.

    In the Redis Cache documentation https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-azure-active-directory-for-authentication#client-library-support it is mentioned for different languages.

    Hope this helps. If this answers your query, do click Accept Answer and Mark Helpful for the same. And, if you have any further query do let us know.

    Thank you.

    Was this answer helpful?

    1 person found this answer 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.