Skip to content

Commit 2ae09d3

Browse files
Service Management tags
1 parent a2dd76d commit 2ae09d3

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationCertificate.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Security.Permissions;
2020
using Microsoft.Azure.Commands.Automation.Model;
2121
using Microsoft.Azure.Commands.Automation.Common;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2223

2324
namespace Microsoft.Azure.Commands.Automation.Cmdlet
2425
{
@@ -71,7 +72,7 @@ public class NewAzureAutomationCertificate : AzureAutomationBaseCmdlet
7172
protected override void AutomationExecuteCmdlet()
7273
{
7374

74-
var createdCertificate = this.AutomationClient.CreateCertificate(this.AutomationAccountName, this.Name, this.Path, this.Password, this.Description, this.Exportable.IsPresent);
75+
var createdCertificate = this.AutomationClient.CreateCertificate(this.AutomationAccountName, this.Name, this.ResolvePath(this.Path), this.Password, this.Description, this.Exportable.IsPresent);
7576

7677
this.WriteObject(createdCertificate);
7778
}

src/ServiceManagement/Automation/Commands.Automation/Cmdlet/SetAzureAutomationCertificate.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Security.Permissions;
2020
using Microsoft.Azure.Commands.Automation.Model;
2121
using Microsoft.Azure.Commands.Automation.Common;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2223

2324
namespace Microsoft.Azure.Commands.Automation.Cmdlet
2425
{
@@ -71,7 +72,7 @@ public class SetAzureAutomationCertificate : AzureAutomationBaseCmdlet
7172
protected override void AutomationExecuteCmdlet()
7273
{
7374

74-
var updateddCertificate = this.AutomationClient.UpdateCertificate(this.AutomationAccountName, this.Name, this.Path, this.Password, this.Description, this.Exportable);
75+
var updateddCertificate = this.AutomationClient.UpdateCertificate(this.AutomationAccountName, this.Name, this.ResolvePath(this.Path), this.Password, this.Description, this.Exportable);
7576

7677
this.WriteObject(updateddCertificate);
7778
}

src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ public Runbook CreateRunbookByName(string automationAccountName, string runbookN
192192
{
193193
Description = description,
194194
RunbookType = RunbookTypeEnum.Script,
195-
Draft = new RunbookDraft()
195+
Draft = new RunbookDraft(),
196+
ServiceManagementTags = (tags != null) ? string.Join(Constants.RunbookTagsSeparatorString, tags) : null
196197
};
197198

198199
var rdcparam = new RunbookCreateDraftParameters() { Name = runbookName, Properties = rdcprop, Tags = null };
@@ -259,10 +260,14 @@ public Runbook UpdateRunbook(string automationAccountName, string runbookName, s
259260
var runbookUpdateParameters = new RunbookUpdateParameters();
260261
runbookUpdateParameters.Name = runbookName;
261262
runbookUpdateParameters.Tags = null;
263+
262264
runbookUpdateParameters.Properties = new RunbookUpdateProperties();
263265
runbookUpdateParameters.Properties.Description = description ?? runbookModel.Properties.Description;
264266
runbookUpdateParameters.Properties.LogProgress = (logProgress.HasValue) ? logProgress.Value : runbookModel.Properties.LogProgress;
265267
runbookUpdateParameters.Properties.LogVerbose = (logVerbose.HasValue) ? logVerbose.Value : runbookModel.Properties.LogVerbose;
268+
runbookUpdateParameters.Properties.ServiceManagementTags = (tags != null)
269+
? string.Join(Constants.RunbookTagsSeparatorString, tags)
270+
: runbookModel.Properties.ServiceManagementTags;
266271

267272
var runbook = this.automationManagementClient.Runbooks.Update(automationAccountName, runbookUpdateParameters).Runbook;
268273

src/ServiceManagement/Automation/Commands.Automation/Model/Runbook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public Runbook(string accountName, AutomationManagement.Models.Runbook runbook)
4848
this.AutomationAccountName = accountName;
4949
this.Name = runbook.Name;
5050
this.Location = runbook.Location;
51-
this.Tags = null;
5251

5352
if (runbook.Properties == null) return;
5453

@@ -61,6 +60,7 @@ public Runbook(string accountName, AutomationManagement.Models.Runbook runbook)
6160
this.State = runbook.Properties.State;
6261
this.JobCount = runbook.Properties.JobCount;
6362
this.RunbookType = runbook.Properties.RunbookType;
63+
this.Tags = runbook.Properties.ServiceManagementTags != null ? runbook.Properties.ServiceManagementTags.Split(Constants.RunbookTagsSeparatorChar) : new string[] { };
6464

6565
this.Parameters = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
6666
foreach (var kvp in runbook.Properties.Parameters)

0 commit comments

Comments
 (0)