Skip to content

Commit 95967c4

Browse files
author
Maddie Clayton
authored
Merge branch 'preview' into resolvepath
2 parents aec74fc + dc54a11 commit 95967c4

34 files changed

+10020
-13839
lines changed

Azure.PowerShell.Netcore.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tools.Common.Netcore", "too
123123
EndProject
124124
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StaticAnalysis.Netcore", "tools\StaticAnalysis\StaticAnalysis.Netcore.csproj", "{493FA948-DA9C-47CD-8385-3C0261377D86}"
125125
EndProject
126+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.RedisCache.Netcore", "src\ResourceManager\RedisCache\Commands.RedisCache\Commands.RedisCache.Netcore.csproj", "{06B4370D-D375-482C-AD23-CFDAC0176147}"
127+
EndProject
126128
Global
127129
GlobalSection(SolutionConfigurationPlatforms) = preSolution
128130
Debug|Any CPU = Debug|Any CPU
@@ -853,6 +855,18 @@ Global
853855
{493FA948-DA9C-47CD-8385-3C0261377D86}.Release|x64.Build.0 = Release|Any CPU
854856
{493FA948-DA9C-47CD-8385-3C0261377D86}.Release|x86.ActiveCfg = Release|Any CPU
855857
{493FA948-DA9C-47CD-8385-3C0261377D86}.Release|x86.Build.0 = Release|Any CPU
858+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
859+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Debug|Any CPU.Build.0 = Debug|Any CPU
860+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Debug|x64.ActiveCfg = Debug|Any CPU
861+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Debug|x64.Build.0 = Debug|Any CPU
862+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Debug|x86.ActiveCfg = Debug|Any CPU
863+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Debug|x86.Build.0 = Debug|Any CPU
864+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Release|Any CPU.ActiveCfg = Release|Any CPU
865+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Release|Any CPU.Build.0 = Release|Any CPU
866+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Release|x64.ActiveCfg = Release|Any CPU
867+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Release|x64.Build.0 = Release|Any CPU
868+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Release|x86.ActiveCfg = Release|Any CPU
869+
{06B4370D-D375-482C-AD23-CFDAC0176147}.Release|x86.Build.0 = Release|Any CPU
856870
EndGlobalSection
857871
GlobalSection(SolutionProperties) = preSolution
858872
HideSolutionNode = FALSE

build.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@
134134
<Target Name="Clean">
135135
<Message Importance="high" Text="Cleaning Cmdlets..." ContinueOnError="false" />
136136

137+
<!-- Clean out the NuGet cache -->
138+
<Exec ContinueOnError="false"
139+
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; $Path = Join-Path $env:USERPROFILE .nuget; if (Test-Path $Path) { Remove-Item $Path -Recurse } &quot;"/>
140+
137141
<!-- Clean out the NuGet cache -->
138142
<Exec ContinueOnError="false"
139143
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; $Path = Join-Path $env:USERPROFILE .nuget; if (Test-Path $Path) { Remove-Item $Path -Recurse } &quot;"/>

src/ResourceManager/KeyVault/Commands.KeyVault/help/Set-AzureRmKeyVaultAccessPolicy.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ The acceptable values for this parameter:
450450
- Setissuers
451451
- Deleteissuers
452452
- Manageissuers
453+
- Recover
454+
- Backup
455+
- Restore
456+
- Purge
453457
454458
```yaml
455459
Type: System.String[]

src/ResourceManager/Profile/Commands.Profile.Test/EnvironmentCmdletTests.cs

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.Azure.Commands.Common.Authentication;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
1717
using Microsoft.Azure.Commands.Common.Authentication.Models;
18+
using Microsoft.Azure.Commands.Common.Authentication.ResourceManager;
1819
using Microsoft.Azure.Commands.Profile;
1920
using Microsoft.Azure.Commands.Profile.Models;
2021
using Microsoft.Azure.Commands.Profile.Utilities;
@@ -715,6 +716,104 @@ public void SetEnvironmentForStack()
715716
Assert.Equal(env3.GetEndpoint(AzureEnvironment.Endpoint.Gallery), cmdlet3.GalleryEndpoint);
716717
}
717718

719+
[Fact]
720+
[Trait(Category.AcceptanceType, Category.CheckIn)]
721+
public void SetEnvironmentForMultipleContexts()
722+
{
723+
// Add new environment
724+
Mock<ICommandRuntime> commandRuntimeMock = new Mock<ICommandRuntime>();
725+
SetupConfirmation(commandRuntimeMock);
726+
var cmdlet = new AddAzureRMEnvironmentCommand()
727+
{
728+
CommandRuntime = commandRuntimeMock.Object,
729+
Name = "Katal",
730+
ARMEndpoint = "https://management.azure.com/",
731+
AzureKeyVaultDnsSuffix = "vault.local.azurestack.external",
732+
AzureKeyVaultServiceEndpointResourceId = "https://vault.local.azurestack.external"
733+
734+
};
735+
var dict = new Dictionary<string, object>
736+
{
737+
{ "ARMEndpoint", "https://management.azure.com/" },
738+
{ "AzureKeyVaultDnsSuffix", "vault.local.azurestack.external" },
739+
{ "AzureKeyVaultServiceEndpointResourceId", "https://vault.local.azurestack.external" }
740+
};
741+
742+
cmdlet.SetBoundParameters(dict);
743+
cmdlet.SetParameterSet("ARMEndpoint");
744+
cmdlet.InvokeBeginProcessing();
745+
cmdlet.ExecuteCmdlet();
746+
cmdlet.InvokeEndProcessing();
747+
var profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.GetProfile<AzureRmProfile>());
748+
IAzureEnvironment env = AzureRmProfileProvider.Instance.Profile.Environments.First((e) => string.Equals(e.Name, "KaTaL", StringComparison.OrdinalIgnoreCase));
749+
Assert.Equal(env.Name, cmdlet.Name);
750+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix), dict["AzureKeyVaultDnsSuffix"]);
751+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId), dict["AzureKeyVaultServiceEndpointResourceId"]);
752+
753+
// Create contexts using the new environment
754+
var profile = new AzureRmProfile();
755+
string contextName1;
756+
var context1 = (new AzureContext { Environment = env })
757+
.WithAccount(new AzureAccount { Id = "[email protected]" })
758+
.WithTenant(new AzureTenant { Id = Guid.NewGuid().ToString(), Directory = "contoso.com" })
759+
.WithSubscription(new AzureSubscription { Id = Guid.NewGuid().ToString(), Name = "Contoso Subscription 1" });
760+
profile.TryAddContext(context1, out contextName1);
761+
string contextName2;
762+
var context2 = (new AzureContext { Environment = env })
763+
.WithAccount(new AzureAccount { Id = "[email protected]" })
764+
.WithTenant(new AzureTenant { Id = Guid.NewGuid().ToString(), Directory = "contoso.cn" })
765+
.WithSubscription(new AzureSubscription { Id = Guid.NewGuid().ToString(), Name = "Contoso Subscription 2" });
766+
profile.TryAddContext(context2, out contextName2);
767+
profile.TrySetDefaultContext(context1);
768+
AzureRmProfileProvider.Instance.Profile = profile;
769+
770+
// Update the environment with new endpoints
771+
commandRuntimeMock = new Mock<ICommandRuntime>();
772+
SetupConfirmation(commandRuntimeMock);
773+
var cmdlet2 = new AddAzureRMEnvironmentCommand()
774+
{
775+
CommandRuntime = commandRuntimeMock.Object,
776+
Name = "Katal",
777+
ARMEndpoint = "https://management.azure.com/",
778+
AzureKeyVaultDnsSuffix = "adminvault.local.azurestack.external",
779+
AzureKeyVaultServiceEndpointResourceId = "https://adminvault.local.azurestack.external"
780+
};
781+
782+
dict.Clear();
783+
dict = new Dictionary<string, object>
784+
{
785+
{ "ARMEndpoint", "https://management.azure.com/" },
786+
{ "AzureKeyVaultDnsSuffix", "adminvault.local.azurestack.external" },
787+
{ "AzureKeyVaultServiceEndpointResourceId", "https://adminvault.local.azurestack.external" }
788+
};
789+
790+
cmdlet2.SetBoundParameters(dict);
791+
cmdlet2.SetParameterSet("ARMEndpoint");
792+
cmdlet2.InvokeBeginProcessing();
793+
cmdlet2.ExecuteCmdlet();
794+
cmdlet2.InvokeEndProcessing();
795+
796+
profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.GetProfile<AzureRmProfile>());
797+
env = AzureRmProfileProvider.Instance.Profile.Environments.First((e) => string.Equals(e.Name, "KaTaL", StringComparison.OrdinalIgnoreCase));
798+
Assert.Equal(env.Name, cmdlet.Name);
799+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix), dict["AzureKeyVaultDnsSuffix"]);
800+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId), dict["AzureKeyVaultServiceEndpointResourceId"]);
801+
802+
// Validate that the endpoints were updated in the contexts
803+
profile = (AzureRmProfile)AzureRmProfileProvider.Instance.Profile;
804+
Assert.NotNull(profile);
805+
Assert.NotNull(profile.Contexts);
806+
Assert.NotEmpty(profile.Contexts);
807+
foreach (var context in profile.Contexts.Values)
808+
{
809+
Assert.NotNull(context);
810+
Assert.NotNull(context.Environment);
811+
Assert.Equal(context.Environment.Name, env.Name);
812+
Assert.Equal(context.Environment.AzureKeyVaultDnsSuffix, env.AzureKeyVaultDnsSuffix);
813+
Assert.Equal(context.Environment.AzureKeyVaultServiceEndpointResourceId, env.AzureKeyVaultServiceEndpointResourceId);
814+
}
815+
}
816+
718817
[Fact]
719818
[Trait(Category.AcceptanceType, Category.CheckIn)]
720819
public void RemovesAzureEnvironment()

src/ResourceManager/Profile/Commands.Profile.Test/LoginCmdletTests.cs

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,5 +463,94 @@ public void LoginUsingSkipValidation()
463463
Assert.Equal(AzureRmProfileProvider.Instance.Profile.DefaultContext.Subscription.Id, cmdlt.Subscription);
464464
Assert.Equal(AzureRmProfileProvider.Instance.Profile.DefaultContext.Tenant.Id, cmdlt.TenantId);
465465
}
466+
467+
[Fact]
468+
[Trait(Category.AcceptanceType, Category.LiveOnly)]
469+
public void AddEnvironmentUpdatesContext()
470+
{
471+
var cmdlet = new AddAzureRMEnvironmentCommand()
472+
{
473+
CommandRuntime = commandRuntimeMock,
474+
Name = "Katal",
475+
ARMEndpoint = "https://management.azure.com/",
476+
AzureKeyVaultDnsSuffix = "vault.local.azurestack.external",
477+
AzureKeyVaultServiceEndpointResourceId = "https://vault.local.azurestack.external"
478+
479+
};
480+
var dict = new Dictionary<string, object>
481+
{
482+
{ "ARMEndpoint", "https://management.azure.com/" },
483+
{ "AzureKeyVaultDnsSuffix", "vault.local.azurestack.external" },
484+
{ "AzureKeyVaultServiceEndpointResourceId", "https://vault.local.azurestack.external" }
485+
};
486+
487+
cmdlet.SetBoundParameters(dict);
488+
cmdlet.SetParameterSet("ARMEndpoint");
489+
cmdlet.InvokeBeginProcessing();
490+
cmdlet.ExecuteCmdlet();
491+
cmdlet.InvokeEndProcessing();
492+
493+
commandRuntimeMock = new MockCommandRuntime();
494+
var profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.GetProfile<AzureRmProfile>());
495+
IAzureEnvironment env = AzureRmProfileProvider.Instance.Profile.Environments.First((e) => string.Equals(e.Name, "KaTaL", StringComparison.OrdinalIgnoreCase));
496+
Assert.Equal(env.Name, cmdlet.Name);
497+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix), dict["AzureKeyVaultDnsSuffix"]);
498+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId), dict["AzureKeyVaultServiceEndpointResourceId"]);
499+
500+
var cmdlet1 = new ConnectAzureRmAccountCommand();
501+
cmdlet1.CommandRuntime = commandRuntimeMock;
502+
cmdlet1.Environment = "Katal";
503+
504+
dict.Clear();
505+
dict = new Dictionary<string, object>
506+
{
507+
{ "Environment", cmdlet1.Environment }
508+
};
509+
510+
cmdlet1.SetBoundParameters(dict);
511+
cmdlet1.InvokeBeginProcessing();
512+
cmdlet1.ExecuteCmdlet();
513+
cmdlet1.InvokeEndProcessing();
514+
commandRuntimeMock = new MockCommandRuntime();
515+
516+
Assert.NotNull(AzureRmProfileProvider.Instance.Profile.DefaultContext);
517+
Assert.Equal(AzureRmProfileProvider.Instance.Profile.DefaultContext.Environment.Name, cmdlet1.Environment);
518+
519+
var cmdlet2 = new AddAzureRMEnvironmentCommand()
520+
{
521+
CommandRuntime = commandRuntimeMock,
522+
Name = "Katal",
523+
ARMEndpoint = "https://management.azure.com/",
524+
AzureKeyVaultDnsSuffix = "adminvault.local.azurestack.external",
525+
AzureKeyVaultServiceEndpointResourceId = "https://adminvault.local.azurestack.external"
526+
};
527+
528+
dict.Clear();
529+
dict = new Dictionary<string, object>
530+
{
531+
{ "ARMEndpoint", "https://management.azure.com/" },
532+
{ "AzureKeyVaultDnsSuffix", "adminvault.local.azurestack.external" },
533+
{ "AzureKeyVaultServiceEndpointResourceId", "https://adminvault.local.azurestack.external" }
534+
};
535+
536+
cmdlet2.SetBoundParameters(dict);
537+
cmdlet2.SetParameterSet("ARMEndpoint");
538+
cmdlet2.InvokeBeginProcessing();
539+
cmdlet2.ExecuteCmdlet();
540+
cmdlet2.InvokeEndProcessing();
541+
542+
profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.GetProfile<AzureRmProfile>());
543+
env = AzureRmProfileProvider.Instance.Profile.Environments.First((e) => string.Equals(e.Name, "KaTaL", StringComparison.OrdinalIgnoreCase));
544+
Assert.Equal(env.Name, cmdlet.Name);
545+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix), dict["AzureKeyVaultDnsSuffix"]);
546+
Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId), dict["AzureKeyVaultServiceEndpointResourceId"]);
547+
548+
var context = AzureRmProfileProvider.Instance.Profile.DefaultContext;
549+
Assert.NotNull(context);
550+
Assert.NotNull(context.Environment);
551+
Assert.Equal(context.Environment.Name, env.Name);
552+
Assert.Equal(context.Environment.AzureKeyVaultDnsSuffix, env.AzureKeyVaultDnsSuffix);
553+
Assert.Equal(context.Environment.AzureKeyVaultServiceEndpointResourceId, env.AzureKeyVaultServiceEndpointResourceId);
554+
}
466555
}
467556
}

src/ResourceManager/Profile/Commands.Profile/Account/ConnectAzureRmAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class ConnectAzureRmAccountCommand : AzureContextModificationCmdlet, IMod
7070
[Parameter(ParameterSetName = ServicePrincipalParameterSet,
7171
Mandatory = true)]
7272
[Parameter(ParameterSetName = ServicePrincipalCertificateParameterSet,
73-
Mandatory = true)]
73+
Mandatory = false)]
7474
public SwitchParameter ServicePrincipal { get; set; }
7575

7676
[Parameter(ParameterSetName = UserParameterSet,

src/ResourceManager/Profile/Commands.Profile/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
- Changed -ServicePrincipal to non-mandatory in the ServicePrincipalCertificateWithSubscriptionId parameter set
2122

2223
## Version 5.5.1
2324
* Fixed issue with default resource groups not being set.

src/ResourceManager/Profile/Commands.Profile/help/Connect-AzureRmAccount.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,19 @@ Indicates that this account authenticates by providing service principal credent
402402
403403
```yaml
404404
Type: System.Management.Automation.SwitchParameter
405-
Parameter Sets: ServicePrincipalWithSubscriptionId, ServicePrincipalCertificateWithSubscriptionId
405+
Parameter Sets: ServicePrincipalCertificateWithSubscriptionId
406+
Aliases:
407+
408+
Required: False
409+
Position: Named
410+
Default value: None
411+
Accept pipeline input: False
412+
Accept wildcard characters: False
413+
```
414+
415+
```yaml
416+
Type: System.Management.Automation.SwitchParameter
417+
Parameter Sets: ServicePrincipalWithSubscriptionId
406418
Aliases:
407419

408420
Required: True

src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.Netcore.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@
2424
</PropertyGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="Microsoft.Azure.Insights" Version="0.11.0-preview" />
27+
<PackageReference Include="Microsoft.Azure.Insights" Version="0.15.0-preview" />
2828
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="4.4.0" />
2929
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="6.5.0-preview" />
30-
<PackageReference Include="Microsoft.WindowsAzure.Configuration" Version="3.2.0" />
31-
<PackageReference Include="Microsoft.WindowsAzure.Storage" Version="6.1.0" />
32-
<PackageReference Include="Moq" Version="4.2.1510.2205" />
3330
</ItemGroup>
3431

3532
<ItemGroup>

src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="Microsoft.Azure.Insights">
44-
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.11.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
43+
<Reference Include="Microsoft.Azure.Insights, Version=0.15.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
44+
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.15.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
4545
<Private>True</Private>
4646
</Reference>
4747
<Reference Include="Microsoft.Azure.Management.Redis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -52,25 +52,6 @@
5252
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.6.5.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
5353
<Private>True</Private>
5454
</Reference>
55-
<Reference Include="Microsoft.Data.Edm">
56-
<HintPath>..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
57-
<Private>True</Private>
58-
</Reference>
59-
<Reference Include="Microsoft.Data.OData">
60-
<HintPath>..\..\..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
61-
<Private>True</Private>
62-
</Reference>
63-
<Reference Include="Microsoft.Data.Services.Client">
64-
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
65-
<Private>True</Private>
66-
</Reference>
67-
<Reference Include="Microsoft.WindowsAzure.Storage">
68-
<HintPath>..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
69-
</Reference>
70-
<Reference Include="System.Spatial">
71-
<HintPath>..\..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
72-
<Private>True</Private>
73-
</Reference>
7455
</ItemGroup>
7556
<ItemGroup>
7657
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -102,9 +83,6 @@
10283
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestImportExportReboot.json">
10384
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
10485
</None>
105-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestMaxMemoryPolicyErrorCheck.json">
106-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
107-
</None>
10886
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
10987
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11088
</None>

src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static RedisCacheController NewInstance
6262
private void SetupManagementClients(MockContext context)
6363
{
6464
RedisManagementClient = GetRedisManagementClient(context);
65-
InsightsManagementClient = GetInsightsManagementClient();
65+
InsightsManagementClient = GetInsightsManagementClient(context);
6666
ResourceManagementClient = GetResourceManagementClient();
6767
NewResourceManagementClient = GetResourceManagementClient(context);
6868
StorageClient = GetStorageManagementClient(context);
@@ -122,9 +122,9 @@ private RedisManagementClient GetRedisManagementClient(MockContext context)
122122
return context.GetServiceClient<RedisManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
123123
}
124124

125-
private InsightsManagementClient GetInsightsManagementClient()
125+
private InsightsManagementClient GetInsightsManagementClient(MockContext context)
126126
{
127-
return LegacyTest.TestBase.GetServiceClient<InsightsManagementClient>(this.csmTestFactory);
127+
return context.GetServiceClient<InsightsManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
128128
}
129129

130130
private ResourceManagementClient GetResourceManagementClient()

0 commit comments

Comments
 (0)