Skip to content

Commit 1fede96

Browse files
author
Maddie Clayton
authored
Merge pull request #8553 from lwajswaj/fix/issue_8494
Fixes Set-AzKeyVaultSecret to allow objects as Tags (Issue #8494)
2 parents 2242d0e + 8fbd6da commit 1fede96

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/KeyVault/KeyVault/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
## Upcoming Release
21+
* Fix tagging on Set-AzKeyVaultSecret
2122

2223
## Version 1.0.1
2324
* Update incorrect online help URLs

src/KeyVault/KeyVault/Commands/SetAzureKeyVaultSecret.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ----------------------------------------------------------------------------------
1+
// ----------------------------------------------------------------------------------
22
//
33
// Copyright Microsoft Corporation
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +14,10 @@
1414

1515
using Microsoft.Azure.Commands.KeyVault.Models;
1616
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
17+
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
1718
using System;
1819
using System.Collections;
20+
using System.Collections.Generic;
1921
using System.Management.Automation;
2022
using System.Security;
2123

@@ -120,14 +122,15 @@ public override void ExecuteCmdlet()
120122
VaultName = InputObject.VaultName;
121123
Name = InputObject.Name;
122124
}
123-
125+
124126
if (ShouldProcess(Name, Properties.Resources.SetSecret))
125127
{
126128
var secret = DataServiceClient.SetSecret(
127129
VaultName,
128130
Name,
129131
SecretValue,
130-
new PSKeyVaultSecretAttributes(!Disable.IsPresent, Expires, NotBefore, ContentType, Tag));
132+
new PSKeyVaultSecretAttributes(!Disable.IsPresent, Expires, NotBefore, ContentType,
133+
TagsConversionHelper.CreateTagHashtable(TagsConversionHelper.CreateTagDictionary(this.Tag, true))));
131134
WriteObject(secret);
132135
}
133136
}

0 commit comments

Comments
 (0)