This makes the execution failed systematically, with error "ERR protocol error: invalid bulk length".
To solve this bug, you have to override the User property inside the AzureCacheOptionsProviderWithToken class, and assign its value from the GetUserName function of the AzureCacheOptions
Hello,
Package v3.0.0 introducted the GetUserName function here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheOptions.cs#L81 Which is used to assign the
User
property on theConfigurationOptions
here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheForRedis.cs#L116However, the function is not used to override the
User
property of theAzureOptionsProvider
base class ofAzureCacheOptionsProviderWithToken
which is assigned to ConfigurationOptions.Default here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheForRedis.cs#L115As a consequence, when the reauthentication is done here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheOptionsProviderWithToken.cs#L241 The
User
property passed isnull
because not overridden (as it was in v2.0.0 of the package).This makes the execution failed systematically, with error "ERR protocol error: invalid bulk length".
To solve this bug, you have to override the User property inside the
AzureCacheOptionsProviderWithToken
class, and assign its value from the GetUserName function of theAzureCacheOptions