Skip to content

Commit ef78cbc

Browse files
committed
enable key vault tag update
1 parent 953a377 commit ef78cbc

File tree

5 files changed

+594
-241
lines changed

5 files changed

+594
-241
lines changed

src/KeyVault/KeyVault.Test/Scripts/ControlPlane/KeyVaultManagementTests.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,16 @@ function Test-UpdateKeyVault {
800800
$vault = $vault | Update-AzKeyVault -EnableRbacAuthorization $false
801801
Assert-False { $vault.EnableRbacAuthorization } "6. EnableRbacAuthorization should be false"
802802

803+
# Update Tags
804+
$vault = $vault | Update-AzKeyVault -Tag @{key = "value"}
805+
Assert-AreEqual 1 $vault.Tags.Count "7. Tags should contain a key-value pair (key, value)"
806+
Assert-True { $vault.Tags.Contains("key") } "7. Tags should contain a key-value pair (key, value)"
807+
Assert-AreEqual "value" $vault.Tags["key"] "7. Tags should contain a key-value pair (key, value)"
808+
809+
# Clean Tags
810+
$vault = $vault | Update-AzKeyVault -Tag @{}
811+
Assert-AreEqual 0 $vault.Tags.Count "8. Tags should be empty"
812+
803813
}
804814
finally {
805815
$rg | Remove-AzResourceGroup -Force

0 commit comments

Comments
 (0)