Skip to content

Commit 4d19301

Browse files
[Redis] Add support for 2022-06-01 API version (#20511)
* upgrade to Microsft.Azure.Management.Redis v9.0.0 * add preferredDataArchiveAuthMethod param to import/export * Update redis version description * list additional linked server properties * lro updates * testing * add argument complete to import/export * documentation updates * update CHANGELOG.md * add nuget.org as package source * add azure-powershell key to nuget.config * don't specify Az.Storage.psd1 * add storage package refrence * Add storage project * Update TestImportExportReboot.json * Update ChangeLog.md * sanitize recordings Co-authored-by: Austin Tolani <[email protected]> Co-authored-by: Dingmeng Xue <[email protected]>
1 parent e8e9766 commit 4d19301

28 files changed

+10622
-14745
lines changed

src/RedisCache/RedisCache.Test/RedisCache.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="8.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="9.0.0" />
16+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="25.0.0" />
1617
</ItemGroup>
1718

1819
<ItemGroup>

src/RedisCache/RedisCache.Test/ScenarioTests/RedisCacheTestRunner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ protected RedisCacheTestRunner(ITestOutputHelper output)
3535
.WithNewRmModules(helper => new[]
3636
{
3737
helper.RMProfileModule,
38-
helper.GetRMModulePath("Az.RedisCache.psd1")
38+
helper.GetRMModulePath("Az.RedisCache.psd1"),
39+
helper.GetRMModulePath("Az.Storage.psd1")
3940
})
4041
.WithNewRecordMatcherArguments(
4142
userAgentsToIgnore: new Dictionary<string, string>(),

src/RedisCache/RedisCache.Test/ScenarioTests/RedisCacheTests.ps1

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function Test-RedisCache
1313
New-AzResourceGroup -Name $resourceGroupName -Location $location
1414

1515
# Creating Cache
16-
$cacheCreated = New-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size P1 -Sku Premium -RedisVersion 6
16+
$cacheCreated = New-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size P1 -Sku Premium -RedisVersion latest
1717

1818
Assert-AreEqual $cacheName $cacheCreated.Name
1919
Assert-AreEqual $location $cacheCreated.Location
@@ -25,7 +25,7 @@ function Test-RedisCache
2525
Assert-AreEqual "creating" $cacheCreated.ProvisioningState
2626
Assert-AreEqual "6GB" $cacheCreated.Size
2727
Assert-AreEqual "Premium" $cacheCreated.Sku
28-
Assert-AreEqual "6" $cacheCreated.RedisVersion.split(".")[0]
28+
Assert-AreEqual "6" $cacheCreated.RedisVersion.split(".")[0] # May need to update if 'latest' is > 6
2929

3030
Assert-NotNull $cacheCreated.PrimaryKey "PrimaryKey do not exists"
3131
Assert-NotNull $cacheCreated.SecondaryKey "SecondaryKey do not exists"
@@ -530,14 +530,17 @@ function Test-ImportExportReboot
530530

531531
# Tests ExportRMAzureRedisCache
532532
Export-AzRedisCache -Name $cacheName -Prefix $prefix -Container $sasKeyForContainer
533+
# Tests export with ManagedIdentity fails when managed identity not enabled on storage account/cache
534+
Assert-Throws {Export-AzRedisCache -Name $cacheName -Prefix $prefix -Container $sasKeyForContainer -PreferredDataArchiveAuthMethod ManagedIdentity}
533535

534536
# Get SAS token for blob
535537
$sasKeyForBlob = ""
536538
Get-SasForBlob $resourceGroupName $storageName $storageContainerName $prefix ([ref]$sasKeyForBlob)
537539

538540
# Tests ImportAzureRmRedisCache
539541
Import-AzRedisCache -Name $cacheName -Files @($sasKeyForBlob) -Force
540-
542+
# Tests import with ManagedIdentity fails when managed identity not enabled on storage account/cache
543+
Assert-Throws {Import-AzRedisCache -Name $cacheName -Files @($sasKeyForBlob) -Force -PreferredDataArchiveAuthMethod ManagedIdentity}
541544
############################# Tests ResetRMAzureRedisCache #############################
542545
$rebootType = "PrimaryNode"
543546
Reset-AzRedisCache -Name $cacheName -RebootType $rebootType -Force
@@ -647,6 +650,10 @@ function Test-GeoReplication
647650
Assert-AreEqual "creating" $linkCreated.ProvisioningState
648651
Assert-AreEqual $cacheName1 $linkCreated.PrimaryServerName
649652
Assert-AreEqual $cacheName2 $linkCreated.SecondaryServerName
653+
Assert-NotNull $linkCreated.PrimaryHostName
654+
Assert-NotNull $linkCreated.GeoReplicatedPrimaryHostName
655+
Assert-NotNull $linkCreated.ServerRole
656+
Assert-NotNull $linkCreated.LinkedRedisCacheLocation
650657

651658
############################# GetAzureRedisCacheLink #############################
652659
# Get single links and wait for creation to comeplte
@@ -667,10 +674,13 @@ function Test-GeoReplication
667674
$linkGet = Get-AzRedisCacheLink -Name $cacheName1
668675
Assert-AreEqual $cacheName1 $linkGet[0].PrimaryServerName
669676
Assert-AreEqual $cacheName2 $linkGet[0].SecondaryServerName
677+
Assert-AreEqual $linkGet.ServerRole "Secondary"
678+
Assert-AreEqual $linkGet.LinkedRedisCacheLocation $location2
670679
$linkGet = Get-AzRedisCacheLink -Name $cacheName2
671680
Assert-AreEqual $cacheName1 $linkGet[0].PrimaryServerName
672681
Assert-AreEqual $cacheName2 $linkGet[0].SecondaryServerName
673-
682+
Assert-AreEqual $linkGet.ServerRole "Primary"
683+
Assert-AreEqual $linkGet.LinkedRedisCacheLocation $location1
674684
# Get links where server is primary
675685
$linkGet = Get-AzRedisCacheLink -PrimaryServerName $cacheName1
676686
Assert-AreEqual $cacheName1 $linkGet[0].PrimaryServerName
@@ -894,7 +904,7 @@ function Test-ManagedIdentity
894904
New-AzResourceGroup -Name $resourceGroupName -Location $location
895905

896906
# Creating Cache
897-
$cacheCreated = New-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size 1GB -Sku Standard -IdentityType SystemAssignedUserAssigned -UserAssignedIdentity "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test","/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2"
907+
$cacheCreated = New-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size 1GB -Sku Standard -IdentityType SystemAssignedUserAssigned -UserAssignedIdentity "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami","/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2"
898908

899909
Assert-AreEqual $cacheName $cacheCreated.Name
900910
Assert-AreEqual $location $cacheCreated.Location
@@ -904,8 +914,8 @@ function Test-ManagedIdentity
904914
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("PrincipalId")
905915
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("TenantId")
906916
Assert-AreEqual 2 $cacheCreated.UserAssignedIdentity.Count
907-
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test")
908-
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2")
917+
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami")
918+
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2")
909919

910920

911921
$cacheCreated = Get-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName
@@ -914,8 +924,8 @@ function Test-ManagedIdentity
914924
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("PrincipalId")
915925
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("TenantId")
916926
Assert-AreEqual 2 $cacheCreated.UserAssignedIdentity.Count
917-
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test")
918-
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2")
927+
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami")
928+
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2")
919929

920930

921931
# In loop to check if cache exists
@@ -932,15 +942,15 @@ function Test-ManagedIdentity
932942

933943

934944
# Test updating user assigned identity
935-
$cacheCreated = Set-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -IdentityType SystemAssignedUserAssigned -UserAssignedIdentity "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2"
945+
$cacheCreated = Set-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -IdentityType SystemAssignedUserAssigned -UserAssignedIdentity "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2"
936946

937947
Assert-AreEqual "SystemAssignedUserAssigned" $cacheCreated.IdentityType
938948
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("PrincipalId")
939949
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("TenantId")
940950
Assert-AreEqual 1 $cacheCreated.UserAssignedIdentity.Count
941-
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2")
951+
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2")
942952

943-
Start-TestSleep -Seconds 60
953+
Start-TestSleep -Seconds 200
944954
# Test removing user assigned identity
945955
$cacheCreated = Set-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -IdentityType SystemAssigned
946956

@@ -949,16 +959,16 @@ function Test-ManagedIdentity
949959
Assert-NotNull $cacheCreated.SystemAssignedIdentity.Item("TenantId")
950960
Assert-Null $cacheCreated.UserAssignedIdentity
951961

952-
Start-TestSleep -Seconds 60
962+
Start-TestSleep -Seconds 200
953963
# Test removing system assigned identity
954-
$cacheCreated = Set-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -IdentityType UserAssigned -UserAssignedIdentity "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2"
964+
$cacheCreated = Set-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -IdentityType UserAssigned -UserAssignedIdentity "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2"
955965

956966
Assert-AreEqual "UserAssigned" $cacheCreated.IdentityType
957967
Assert-Null $cacheCreated.SystemAssignedIdentity
958968
Assert-AreEqual 1 $cacheCreated.UserAssignedIdentity.Count
959-
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/0ee2a145-4d40-44f4-b764-67b40274f1ac/resourceGroups/prn-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test2")
969+
Assert-AreEqual $True ($cacheCreated.UserAssignedIdentity -contains "/subscriptions/3919658b-68ae-4509-8c17-6a2238340ae7/resourcegroups/tolani-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-uami2")
960970

961-
Start-TestSleep -Seconds 60
971+
Start-TestSleep -Seconds 200
962972
# Test removing identity
963973
$cacheCreated = Set-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -IdentityType None
964974

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestFirewallRule.json

Lines changed: 977 additions & 1170 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestGeoReplication.json

Lines changed: 1914 additions & 2115 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestImportExportReboot.json

Lines changed: 1390 additions & 1139 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestMIImportExport.json

Lines changed: 328 additions & 0 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestManagedIdentity.json

Lines changed: 1307 additions & 1469 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestRedisCache.json

Lines changed: 1188 additions & 855 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestRedisCacheClustering.json

Lines changed: 776 additions & 2621 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestRedisCachePatchSchedules.json

Lines changed: 917 additions & 1148 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestRedisCachePipeline.json

Lines changed: 992 additions & 3368 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestSetNonExistingRedisCacheTest.json

Lines changed: 26 additions & 26 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.Test/SessionRecords/Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests/TestZones.json

Lines changed: 665 additions & 794 deletions
Large diffs are not rendered by default.

src/RedisCache/RedisCache.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27703.2042
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.3.32929.385
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RedisCache", "RedisCache\RedisCache.csproj", "{C972E3EF-4461-4758-BA31-93E0947B1253}"
66
EndProject
@@ -20,6 +20,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScenarioTest.ResourceManage
2020
EndProject
2121
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{BC80A1D0-FFA4-43D9-AA74-799F5CB54B58}"
2222
EndProject
23+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage", "..\Storage\Storage\Storage.csproj", "{A2591FA5-BF93-4358-9097-E6D58FE1DDC4}"
24+
EndProject
2325
Global
2426
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2527
Debug|Any CPU = Debug|Any CPU
@@ -38,6 +40,10 @@ Global
3840
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
3941
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
4042
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
45+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
4147
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4248
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
4349
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Release|Any CPU.ActiveCfg = Release|Any CPU

src/RedisCache/RedisCache/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added optional parameter `PreferredDataArchiveAuthMethod` in `Export-AzRedisCache`
22+
* Added optional parameter `PreferredDataArchiveAuthMethod` in `Import-AzRedisCache`
23+
* Added 4 additional properties for a geo replication link: `PrimaryHostName`, `GeoReplicatedPrimaryHostName`, `ServerRole`, and `LinkedRedisCacheLocation`in `Get-AzRedisCacheLink` and `New-AzRedisCacheLink`
2124

2225
## Version 1.6.0
2326
* Added `IdentityType` and `UserAssignedIdentity` parameter in `New-AzRedisCache` and `Set-AzRedisCache` cmdlets.

src/RedisCache/RedisCache/Commands/ExportAzureRedisCache.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public class ExportAzureRedisCache : RedisCacheCmdletBase
4343
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Format for import operation.")]
4444
public string Format { get; set; }
4545

46+
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS.")]
47+
[PSArgumentCompleter("SAS", "ManagedIdentity")]
48+
public string PreferredDataArchiveAuthMethod { get; set; }
49+
4650
[Parameter(Mandatory = false)]
4751
public SwitchParameter PassThru { get; set; }
4852

@@ -56,7 +60,7 @@ public override void ExecuteCmdlet()
5660
Name,
5761
() =>
5862
{
59-
CacheClient.ExportToCache(ResourceGroupName, Name, Container, Prefix, Format);
63+
CacheClient.ExportToCache(ResourceGroupName, Name, Container, Prefix, Format,PreferredDataArchiveAuthMethod);
6064
if (PassThru)
6165
{
6266
WriteObject(true);

src/RedisCache/RedisCache/Commands/ImportAzureRedisCache.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public class ImportAzureRedisCache : RedisCacheCmdletBase
3939
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Format for import operation.")]
4040
public string Format { get; set; }
4141

42+
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS.")]
43+
[PSArgumentCompleter("SAS", "ManagedIdentity")]
44+
public string PreferredDataArchiveAuthMethod { get; set; }
45+
4246
[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
4347
public SwitchParameter Force { get; set; }
4448

@@ -55,7 +59,7 @@ public override void ExecuteCmdlet()
5559
string.Format(Resources.ImportingRedisCache, Name),
5660
string.Format(Resources.ImportRedisCache, Name),
5761
Name,
58-
() => CacheClient.ImportToCache(ResourceGroupName, Name, Files, Format));
62+
() => CacheClient.ImportToCache(ResourceGroupName, Name, Files, Format,PreferredDataArchiveAuthMethod));
5963

6064
if (PassThru)
6165
{

src/RedisCache/RedisCache/Commands/NewAzureRedisCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class NewAzureRedisCache : RedisCacheCmdletBase
8080
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "List of Azure regions with Availability zones.")]
8181
public string[] Zone { get; set; }
8282

83-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Redis version. Valid values: 4, 6")]
83+
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.")]
8484
public string RedisVersion { get; set; }
8585

8686
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Specifies the type of identity used for the Azure Cache for Redis. Valid values: \"SystemAssigned\" or \"UserAssigned\" or \"SystemAssignedUserAssigned\" or \"None\" ")]

src/RedisCache/RedisCache/Commands/SetAzureRedisCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class SetAzureRedisCache : RedisCacheCmdletBase
6262
[PSArgumentCompleter(TlsStrings.OneFullStopZero, TlsStrings.OneFullStopOne, TlsStrings.OneFullStopTwo)]
6363
public string MinimumTlsVersion { get; set; }
6464

65-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Redis version. Valid values: 4, 6")]
65+
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.")]
6666
public string RedisVersion { get; set; }
6767

6868
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents tags.")]

src/RedisCache/RedisCache/Models/PSRedisLinkedServer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public class PSRedisLinkedServer
2222
public string PrimaryServerName { get; set; }
2323
public string SecondaryServerName { get; set; }
2424
public string ProvisioningState { get; set; }
25+
public string LinkedRedisCacheLocation { get; set; }
26+
public string ServerRole { get; set; }
27+
public string PrimaryHostName { get; set; }
28+
public string GeoReplicatedPrimaryHostName { get; set; }
2529

2630
public PSRedisLinkedServer() { }
2731

@@ -48,6 +52,10 @@ internal PSRedisLinkedServer(RedisLinkedServerWithProperties redisLinkedServer)
4852
PrimaryServerName = ele[8];
4953
SecondaryServerName = ele[10];
5054
}
55+
LinkedRedisCacheLocation = redisLinkedServer.LinkedRedisCacheLocation;
56+
ServerRole = redisLinkedServer.ServerRole.ToString();
57+
PrimaryHostName = redisLinkedServer.PrimaryHostName;
58+
GeoReplicatedPrimaryHostName = redisLinkedServer.GeoReplicatedPrimaryHostName;
5159
}
5260
}
5361
}

0 commit comments

Comments
 (0)