Skip to content

Commit fa6aa01

Browse files
author
maddieclayton
authored
Merge pull request #5285 from SiddharthChatrolaMs/preview
Redis Cache: 6 new cmdlets and update to existing cmdlets
2 parents 934becc + 3e0f5bb commit fa6aa01

File tree

74 files changed

+28058
-5578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+28058
-5578
lines changed

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/AzureRM.Storage.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ function Get-AzureRmStorageAccountKey
132132
$version = $client.GetType().Assembly.GetName().Version
133133
}
134134
PROCESS {
135-
if ($version.Major -gt 3)
135+
if ($version.Major -gt 5)
136+
{
137+
$getTask = $client.StorageAccounts.ListKeysWithHttpMessagesAsync($ResourceGroupName, $name, $null, [System.Threading.CancellationToken]::None)
138+
$result = $getTask.GetAwaiter().GetResult()
139+
Write-Output $result.Body.Keys
140+
}
141+
elseif ($version.Major -gt 3)
136142
{
137143
$getTask = $client.StorageAccounts.ListKeysWithHttpMessagesAsync($ResourceGroupName, $name, $null, [System.Threading.CancellationToken]::None)
138144
$result = $getTask.GetAwaiter().GetResult()

src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,24 @@ FunctionsToExport = @()
8181
CmdletsToExport = 'Remove-AzureRmRedisCachePatchSchedule',
8282
'New-AzureRmRedisCacheScheduleEntry',
8383
'Get-AzureRmRedisCachePatchSchedule',
84-
'New-AzureRmRedisCachePatchSchedule', 'Reset-AzureRmRedisCache',
85-
'Export-AzureRmRedisCache', 'Import-AzureRmRedisCache',
84+
'New-AzureRmRedisCachePatchSchedule',
85+
'Reset-AzureRmRedisCache',
86+
'Export-AzureRmRedisCache',
87+
'Import-AzureRmRedisCache',
8688
'Remove-AzureRmRedisCacheDiagnostics',
87-
'Set-AzureRmRedisCacheDiagnostics', 'Set-AzureRmRedisCache',
88-
'New-AzureRmRedisCacheKey', 'Get-AzureRmRedisCacheKey',
89-
'Get-AzureRmRedisCache', 'Remove-AzureRmRedisCache',
90-
'New-AzureRmRedisCache'
89+
'Set-AzureRmRedisCacheDiagnostics',
90+
'Set-AzureRmRedisCache',
91+
'New-AzureRmRedisCacheKey',
92+
'Get-AzureRmRedisCacheKey',
93+
'Get-AzureRmRedisCache',
94+
'Remove-AzureRmRedisCache',
95+
'New-AzureRmRedisCache',
96+
'New-AzureRmRedisCacheLink',
97+
'Remove-AzureRmRedisCacheLink',
98+
'Get-AzureRmRedisCacheLink',
99+
'New-AzureRmRedisCacheFirewallRule',
100+
'Remove-AzureRmRedisCacheFirewallRule',
101+
'Get-AzureRmRedisCacheFirewallRule'
91102

92103
# Variables to export from this module
93104
# VariablesToExport = @()

src/ResourceManager/RedisCache/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
## Current Release
2121
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
2222
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
23+
* Added 3 new cmdlets for firewall rules
24+
* Added 3 new cmdlets for geo replication
25+
* Added support for zones and tags
26+
* Make ResourceGroup as optional whenever possible.
2327

2428
## Version 4.0.1
2529
* Fixed assembly loading issue that caused some cmdlets to fail when executing

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

Lines changed: 15 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,16 @@
4141
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
4242
</PropertyGroup>
4343
<ItemGroup>
44-
<Reference Include="Hyak.Common">
45-
<HintPath>..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
46-
</Reference>
47-
<Reference Include="Microsoft.Azure.Common">
48-
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
49-
</Reference>
50-
<Reference Include="Microsoft.Azure.Common.NetFramework">
51-
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
52-
</Reference>
5344
<Reference Include="Microsoft.Azure.Insights">
5445
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.11.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
5546
<Private>True</Private>
5647
</Reference>
5748
<Reference Include="Microsoft.Azure.Management.Redis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
58-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.4.2.0-preview\lib\net45\Microsoft.Azure.Management.Redis.dll</HintPath>
49+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.4.4.0\lib\net452\Microsoft.Azure.Management.Redis.dll</HintPath>
5950
<Private>True</Private>
6051
</Reference>
61-
<Reference Include="Microsoft.Azure.Management.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
62-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.5.0.2-preview\lib\net45\Microsoft.Azure.Management.Storage.dll</HintPath>
52+
<Reference Include="Microsoft.Azure.Management.Storage, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.6.5.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
6354
<Private>True</Private>
6455
</Reference>
6556
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -94,14 +85,6 @@
9485
<SpecificVersion>False</SpecificVersion>
9586
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
9687
</Reference>
97-
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
98-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.5\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
99-
<Private>True</Private>
100-
</Reference>
101-
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
102-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.5\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
103-
<Private>True</Private>
104-
</Reference>
10588
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
10689
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
10790
<Private>True</Private>
@@ -110,67 +93,25 @@
11093
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.5.0-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
11194
<Private>True</Private>
11295
</Reference>
113-
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
114-
<SpecificVersion>False</SpecificVersion>
115-
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
116-
</Reference>
117-
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
118-
<SpecificVersion>False</SpecificVersion>
119-
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
120-
</Reference>
121-
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
122-
<SpecificVersion>False</SpecificVersion>
123-
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
124-
</Reference>
12596
<Reference Include="Microsoft.WindowsAzure.Configuration">
12697
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
12798
<Private>True</Private>
12899
</Reference>
129-
<Reference Include="Microsoft.WindowsAzure.Management">
130-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
131-
</Reference>
132-
<Reference Include="Microsoft.Azure.KeyVault.Core">
133-
<HintPath>..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
134-
<Private>True</Private>
135-
</Reference>
136100
<Reference Include="Microsoft.WindowsAzure.Storage">
137101
<HintPath>..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
138102
</Reference>
139103
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
140104
<SpecificVersion>False</SpecificVersion>
141105
<HintPath>..\..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
142106
</Reference>
143-
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
144-
<SpecificVersion>False</SpecificVersion>
145-
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
146-
</Reference>
147-
<Reference Include="System" />
148-
<Reference Include="System.Core" />
149107
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
150108
<SpecificVersion>False</SpecificVersion>
151109
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll</HintPath>
152110
</Reference>
153-
<Reference Include="System.Net" />
154-
<Reference Include="System.Net.Http" />
155-
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
156-
<SpecificVersion>False</SpecificVersion>
157-
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
158-
</Reference>
159-
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
160-
<SpecificVersion>False</SpecificVersion>
161-
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
162-
</Reference>
163-
<Reference Include="System.Net.Http.WebRequest" />
164-
<Reference Include="System.Runtime.Serialization" />
165111
<Reference Include="System.Spatial">
166112
<HintPath>..\..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
167113
<Private>True</Private>
168114
</Reference>
169-
<Reference Include="System.Xml.Linq" />
170-
<Reference Include="System.Data.DataSetExtensions" />
171-
<Reference Include="Microsoft.CSharp" />
172-
<Reference Include="System.Data" />
173-
<Reference Include="System.Xml" />
174115
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
175116
<HintPath>..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
176117
<Private>True</Private>
@@ -236,15 +177,21 @@
236177
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestDiagnosticOperations.json">
237178
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
238179
</None>
239-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestImportExportReboot.json">
180+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestFirewallRule.json">
240181
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
241182
</None>
242-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
183+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestGeoReplication.json">
184+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
185+
</None>
186+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestImportExportReboot.json">
243187
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
244188
</None>
245189
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestMaxMemoryPolicyErrorCheck.json">
246190
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
247191
</None>
192+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
193+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
194+
</None>
248195
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCacheClustering.json">
249196
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
250197
</None>
@@ -257,10 +204,14 @@
257204
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestSetNonExistingRedisCacheTest.json">
258205
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
259206
</None>
207+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestZones.json">
208+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
209+
</None>
260210
</ItemGroup>
261211
<ItemGroup>
262212
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
263213
</ItemGroup>
264214
<ItemGroup />
265215
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
216+
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
266217
</Project>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public void RunPowerShellTest(params string[] scripts)
8383
d.Add("Microsoft.Features", null);
8484
d.Add("Microsoft.Authorization", null);
8585
var providersToIgnore = new Dictionary<string, string>();
86-
providersToIgnore.Add("Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient", "2016-02-01");
8786
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
8887

8988
HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,26 @@ public void TestDiagnosticOperations()
8282
{
8383
RedisCacheController.NewInstance.RunPowerShellTest("Test-DiagnosticOperations");
8484
}
85+
86+
[Fact]
87+
[Trait(Category.AcceptanceType, Category.CheckIn)]
88+
public void TestGeoReplication()
89+
{
90+
RedisCacheController.NewInstance.RunPowerShellTest("Test-GeoReplication");
91+
}
92+
93+
[Fact]
94+
[Trait(Category.AcceptanceType, Category.CheckIn)]
95+
public void TestFirewallRule()
96+
{
97+
RedisCacheController.NewInstance.RunPowerShellTest("Test-FirewallRule");
98+
}
99+
100+
[Fact]
101+
[Trait(Category.AcceptanceType, Category.CheckIn)]
102+
public void TestZones()
103+
{
104+
RedisCacheController.NewInstance.RunPowerShellTest("Test-Zones");
105+
}
85106
}
86107
}

0 commit comments

Comments
 (0)