@@ -59,7 +59,7 @@ internal static Task<string> DetermineApiVersion(AzureContext context, string re
59
59
/// <param name="pre">When specified, indicates if pre-release API versions should be considered.</param>
60
60
internal static Task < string > DetermineApiVersion ( AzureContext context , string providerNamespace , string resourceType , CancellationToken cancellationToken , bool ? pre = null , Dictionary < string , string > cmdletHeaderValues = null )
61
61
{
62
- var cacheKey = ApiVersionCache . GetCacheKey ( providerNamespace : providerNamespace , resourceType : resourceType ) ;
62
+ var cacheKey = ApiVersionCache . GetCacheKey ( context . Environment . Name , providerNamespace : providerNamespace , resourceType : resourceType ) ;
63
63
var apiVersions = ApiVersionCache . Instance
64
64
. AddOrGetExisting ( cacheKey : cacheKey , getFreshData : ( ) => ApiVersionHelper . GetApiVersionsForResourceType (
65
65
context ,
@@ -206,11 +206,12 @@ private void SetCacheItem(string cacheKey, string[] data, DateTimeOffset absolut
206
206
/// <summary>
207
207
/// Gets the cache key.
208
208
/// </summary>
209
+ /// <param name="environmentName">The environment name.</param>
209
210
/// <param name="providerNamespace">The provider namespace.</param>
210
211
/// <param name="resourceType">The resource type.</param>
211
- internal static string GetCacheKey ( string providerNamespace , string resourceType )
212
+ internal static string GetCacheKey ( string environmentName , string providerNamespace , string resourceType )
212
213
{
213
- return string . Format ( "{0}/{1}" , providerNamespace . CoalesceString ( ) , resourceType . CoalesceString ( ) ) . ToUpperInvariant ( ) ;
214
+ return string . Format ( "{0}/{1}/{2}" , environmentName . CoalesceEnumerable ( ) , providerNamespace . CoalesceString ( ) , resourceType . CoalesceString ( ) ) . ToUpperInvariant ( ) ;
214
215
}
215
216
}
216
217
}
0 commit comments