upgrade package version and bug fix for mi to work#27
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades Unified Redis Platform package versions and updates Managed Identity (MI) connectivity behavior to improve stability.
Changes:
- Bumped
Microsoft.UnifiedRedisPlatform.Coreto1.6.0across SDK and test apps. - Updated MI Redis authentication to use
ConfigureForAzureWithTokenCredentialAsyncand adjusted defaults (timeouts/keep-alive). - Added/updated .NET Framework test app dependencies and binding redirects to support the new packages.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/Microsoft.UnifiedRedisPlatform.TestApps/TestWebAppCore.SDK/Microsoft.UnifiedRedisPlatform.TestWebAppCore.SDK.csproj | Adds Core package reference for test web app. |
| src/tests/Microsoft.UnifiedRedisPlatform.TestApps/TestConsoleCore.SDK/Microsoft.UnifiedRedisPlatform.TestConsoleCore.SDK.csproj | Upgrades Core package reference to 1.6.0. |
| src/tests/Microsoft.UnifiedRedisPlatform.TestApps/TestConsole461.SDK/packages.config | Upgrades Core and adds/updates framework dependencies for net472 test app. |
| src/tests/Microsoft.UnifiedRedisPlatform.TestApps/TestConsole461.SDK/Microsoft.UnifiedRedisPlatform.TestConsole461.SDK.csproj | Updates assembly references to align with upgraded packages. |
| src/tests/Microsoft.UnifiedRedisPlatform.TestApps/TestConsole461.SDK/App.config | Adds binding redirects for upgraded/transitive assemblies. |
| src/sdk/Extensions/Microsoft.Extensions.Caching.UnifiedRedisPlatform/Microsoft.Extensions.Caching.UnifiedRedisPlatform.csproj | Bumps extension package version and updates Core dependency + release notes. |
| src/sdk/Core/Services/HttpClientFactory.cs | Sets an explicit HttpClient timeout for URP calls. |
| src/sdk/Core/RedisConnectionBuilder.cs | Updates MI auth flow + keep-alive defaults and formatting tweaks. |
| src/sdk/Core/Microsoft.UnifiedRedisPlatform.Core.nuspec | Bumps nuspec version to 1.6.0 and updates release notes. |
| src/sdk/Core/Microsoft.UnifiedRedisPlatform.Core.csproj | Bumps Core version and updates release notes. |
| src/sdk/Core/Configurations/RetryProtocol.cs | Increases default operation timeout to 10s. |
Comments suppressed due to low confidence (1)
src/sdk/Core/RedisConnectionBuilder.cs:163
- The
elsebranch contradicts the comment: instead of keeping the connection-string password for legacy behavior, it fetches a token and overwritesoptions.Password. If legacy mode is intended when_useManagedIdentityis false, theelsebranch should not acquire/set an AAD token; it should leaveoptions.Passwordas parsed from the connection string (or only perform token logic under the MI path).
options.AbortOnConnectFail = false;
options.Ssl = true;
options.KeepAlive = 60; // Send keep-alive every 60 seconds to prevent stale connections
// Use Managed Identity for Redis authentication if configured
// ConfigureForAzureWithTokenCredentialAsync handles automatic token refresh
// Otherwise, keep the password from the connection string (legacy behavior)
if (_useManagedIdentity && _tokenCredential != null)
{
await options.ConfigureForAzureWithTokenCredentialAsync(_tokenCredential).ConfigureAwait(false);
}
else
{
var token = await GetRedisAccessTokenAsync();
options.Password = token;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.3\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="Microsoft.UnifiedRedisPlatform.Core, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL"> |
There was a problem hiding this comment.
The assembly reference version (1.0.4.0) does not match the referenced package folder (1.6.0). This mismatch can cause build/load failures or require unexpected binding redirects. Update the Reference Include version to the actual assembly version shipped by the 1.6.0 package (or remove the explicit Version=... so MSBuild resolves it from the DLL metadata).
| <Reference Include="Microsoft.UnifiedRedisPlatform.Core, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL"> | |
| <Reference Include="Microsoft.UnifiedRedisPlatform.Core, Culture=neutral, processorArchitecture=MSIL"> |
| <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath> | ||
| <Private>True</Private> | ||
| <Private>True</Private> |
There was a problem hiding this comment.
The System.IO.Compression reference contains duplicate <Private>True</Private> entries. Remove one of them to avoid confusion and keep the project file clean.
| <Private>True</Private> |
| v1.6.0: | ||
| - Fixed: Managed Identity token refresh - now uses ConfigureForAzureWithTokenCredentialAsync for automatic token renewal | ||
| - Improved: Default operation timeout increased from 3s to 10s to accommodate MI token acquisition | ||
| - Improved: Added 60-second keep-alive to prevent stale connections | ||
| - All MI authentication methods (ServerOptions, LocalOptions, Direct Connect) now work correctly | ||
| - Added Managed Identity (MI) support for Azure Redis Cache authentication | ||
| - Upgraded to Microsoft.Azure.StackExchangeRedis 3.2.1 | ||
| - Added ConnectAsync() method for async connection initialization |
There was a problem hiding this comment.
The release notes are labeled v1.6.0 but include items that read like earlier-version features (e.g., 'Added Managed Identity support', 'Upgraded ...', 'Added ConnectAsync()'). Consider splitting these into the correct historical versions (or trimming to only the changes introduced in 1.6.0) so package consumers have accurate versioned change history.
No description provided.