Skip to content

Commit 6498fb9

Browse files
REDMOND\v-ajnavaAjit Navasare (MINDTREE LIMITED)
authored andcommitted
Resolved - Microsoft.IdentityModel.Clients.ActiveDirectory new version
EventHub Cleanup and App.config fix Microsoft.Rest.ClientRuntime.Azure.Authentication - 2.2.9 - preivew Test project updated Review comments resolved. Removed the references from Common library.
1 parent 84346b4 commit 6498fb9

File tree

128 files changed

+99
-17048
lines changed

Some content is hidden

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

128 files changed

+99
-17048
lines changed

src/ResourceManager/EventHub/Commands.EventHub.Test/Commands.EventHubs.Test.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
<HintPath>..\..\..\packages\Microsoft.Azure.Management.EventHub.0.0.1-preview\lib\net45\Microsoft.Azure.Management.EventHub.dll</HintPath>
6161
<Private>True</Private>
6262
</Reference>
63-
<Reference Include="Microsoft.Azure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
64-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.3.0.0\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
63+
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
64+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
6565
<Private>True</Private>
6666
</Reference>
6767
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -70,20 +70,15 @@
7070
<Private>True</Private>
7171
</Reference>
7272
<Reference Include="Microsoft.Azure.Test.Framework">
73-
<SpecificVersion>False</SpecificVersion>
74-
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6052.28118-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
73+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6179.26854-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
7574
</Reference>
7675
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7776
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.6.7-preview\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
7877
<Private>True</Private>
7978
</Reference>
80-
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.28.1.741, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
81-
<SpecificVersion>False</SpecificVersion>
82-
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
83-
</Reference>
84-
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.28.1.741, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
85-
<SpecificVersion>False</SpecificVersion>
86-
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
79+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.28.3.860, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80+
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
81+
<Private>True</Private>
8782
</Reference>
8883
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8984
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>

src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/EventHubsController.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
//using Microsoft.Azure.Gallery;
1717
using Microsoft.Azure.Management.Authorization;
1818
using Microsoft.Azure.Management.Resources;
19-
using Microsoft.Azure.Management.Storage;
2019
using Microsoft.Azure.Management.EventHub;
2120
using Microsoft.Azure.Subscriptions;
2221
using Microsoft.Azure.Test.HttpRecorder;
@@ -33,7 +32,7 @@
3332
namespace Microsoft.Azure.Commands.EventHub.Test.ScenarioTests
3433
{
3534
public class EventHubsController
36-
{
35+
{
3736
private LegacyTest.CSMTestEnvironmentFactory csmTestFactory;
3837
private EnvironmentSetupHelper helper;
3938
private const string TenantIdKey = "TenantId";
@@ -143,10 +142,7 @@ private void SetupManagementClients(MockContext context)
143142
helper.SetupManagementClients(ResourceManagementClient,EventHubsManagementClient);
144143
}
145144

146-
protected StorageManagementClient GetArmStorageManagementClient()
147-
{
148-
return LegacyTest.TestBase.GetServiceClient<StorageManagementClient>(this.csmTestFactory);
149-
}
145+
150146

151147
private AuthorizationManagementClient GetAuthorizationManagementClient()
152148
{

src/ResourceManager/EventHub/Commands.EventHub.Test/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Websites" version="1.2.0-preview" targetFramework="net45" />
12-
<package id="Microsoft.Azure.Test.Framework" version="1.0.6052.28118-prerelease" targetFramework="net45" />
1312
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" />
1413
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
1514
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/ConsumerGroup/NewAzureEventHubConsumerGroups.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ public override void ExecuteCmdlet()
6969

7070
if (!string.IsNullOrEmpty(UserMetadata))
7171
consumerGroup.UserMetadata = UserMetadata;
72-
73-
ConsumerGroupAttributes consumergrpAttributes = Client.CreateOrUpdateConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, consumerGroup.Name, consumerGroup);
7472

75-
WriteObject(consumergrpAttributes);
73+
if (ShouldProcess(target: consumerGroup.Name, action: string.Format("Adding a new Consumer Group {0} under Eventhub {1}", consumerGroup.Name, EventHubName)))
74+
{
75+
WriteObject(Client.CreateOrUpdateConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, consumerGroup.Name, consumerGroup));
76+
}
77+
7678
}
7779
}
7880
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/ConsumerGroup/RemoveAzureEventHubConsumerGroups.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ public class RemoveAzureRmEventHubConsumerGroupp : AzureEventHubsCmdletBase
5252
public override void ExecuteCmdlet()
5353
{
5454
// delete a ConsumerGroup
55-
Client.DeletConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, ConsumerGroupName);
56-
55+
if (ShouldProcess(target:ConsumerGroupName, action: string.Format("Deleting ConsumerGrop:{0} from Eventhub:{1}", ConsumerGroupName, EventHubName)))
56+
{
57+
Client.DeletConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, ConsumerGroupName);
58+
}
5759
}
5860
}
5961
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/ConsumerGroup/SetAzureEventHubConsumerGroups.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ public override void ExecuteCmdlet()
7171
if (!string.IsNullOrEmpty(UserMetadata))
7272
consumerGroup.UserMetadata = UserMetadata;
7373

74-
ConsumerGroupAttributes consumergrpAttributes = Client.CreateOrUpdateConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, consumerGroup.Name, consumerGroup);
75-
WriteObject(consumergrpAttributes);
74+
if(ShouldProcess(target: consumerGroup.Name, action: string.Format("Updating ConsumerGroup: {0} for the Eventhub:{1}",consumerGroup.Name,EventHubName)))
75+
{
76+
WriteObject(Client.CreateOrUpdateConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, consumerGroup.Name, consumerGroup));
77+
}
78+
7679
}
7780
}
7881
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/NewAzureEventHub.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class NewAzureRmEventHub : AzureEventHubsCmdletBase
5555

5656
[Parameter(Mandatory = false,
5757
ValueFromPipelineByPropertyName = true,
58-
ParameterSetName = EventHubParameterSetName,
58+
ParameterSetName = EventHubParameterSetName,
5959
HelpMessage = "EventHub object.")]
6060
[ValidateNotNullOrEmpty]
6161
public EventHubAttributes EventHubObj { get; set; }
@@ -94,8 +94,11 @@ public override void ExecuteCmdlet()
9494
eventHub.Location = Location;
9595
}
9696

97-
EventHubAttributes eventHubAttributes = Client.CreateOrUpdateEventHub(ResourceGroupName, NamespaceName, eventHub.Name, eventHub);
98-
WriteObject(eventHubAttributes);
97+
if(ShouldProcess(target:eventHub.Name, action:string.Format("Creating new EventHub:{0} under NameSpace:{1} ",eventHub.Name,NamespaceName)))
98+
{
99+
WriteObject(Client.CreateOrUpdateEventHub(ResourceGroupName, NamespaceName, eventHub.Name, eventHub));
100+
}
101+
99102
}
100103
}
101104
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/NewAzureEventHubAuthorizationRules.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public class NewAzureEventHubAuthorizationRule : AzureEventHubsCmdletBase
5454

5555
[Parameter(Mandatory = true,
5656
ValueFromPipelineByPropertyName = true,
57-
Position = 4,
5857
HelpMessage = "Rights, e.g. @(\"Listen\",\"Send\",\"Manage\")")]
5958
[ValidateNotNullOrEmpty]
6059
public string[] Rights { get; set; }
@@ -74,10 +73,13 @@ public override void ExecuteCmdlet()
7473
sasRule.Name = AuthorizationRuleName;
7574
sasRule.Rights = newListAry;
7675
sasRule.Location = getEventHub.Location;
76+
7777
// Create a new eventHub authorizationRule
78-
SharedAccessAuthorizationRuleAttributes authRule = Client.CreateOrUpdateEventHubAuthorizationRules(ResourceGroupName, NamespaceName, EventHubName,
79-
sasRule.Name, sasRule);
80-
WriteObject(authRule);
78+
79+
if (ShouldProcess(target: sasRule.Name, action: string.Format("Creating new AuthorizationRule named:{0} for EventHub: {1}", sasRule.Name, EventHubName)))
80+
{
81+
WriteObject(Client.CreateOrUpdateEventHubAuthorizationRules(ResourceGroupName, NamespaceName, EventHubName,sasRule.Name, sasRule));
82+
}
8183
}
8284
}
8385
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/NewAzureEventHubKey.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,22 @@ public class NewAzureRmEventHubKey : AzureEventHubsCmdletBase
5353
public string AuthorizationRuleName { get; set; }
5454

5555
[Parameter(Mandatory = true,
56-
Position = 4,
5756
ParameterSetName = RegenerateKeySetName,
5857
HelpMessage = "Regenerate Keys - 'PrimaryKey'/'SecondaryKey'.")]
5958
[ValidateSet(RegeneKeys.PrimaryKey,
6059
RegeneKeys.SecondaryKey,
61-
IgnoreCase = true)]
62-
[ValidateNotNullOrEmpty]
60+
IgnoreCase = true)]
6361
public string RegenerateKey { get; set; }
6462

6563
public override void ExecuteCmdlet()
6664
{
6765
var regenKey = new RegenerateKeysParameters(ParsePolicyKey(RegenerateKey));
6866

6967
// Get a EventHub List Keys for the specified AuthorizationRule
70-
ListKeysAttributes keys = Client.SetRegenerateKeys(ResourceGroup, NamespaceName, EventHubName, AuthorizationRuleName, RegenerateKey);
71-
WriteObject(keys);
68+
if (ShouldProcess(target: RegenerateKey, action: string.Format("Generating PrimaryKey/SecondaryKey for AuthorizationRule: {0} of EventHub:{1}", AuthorizationRuleName, EventHubName)))
69+
{
70+
WriteObject(Client.SetRegenerateKeys(ResourceGroup, NamespaceName, EventHubName, AuthorizationRuleName, RegenerateKey));
71+
}
7272
}
7373
}
7474
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/RemoveAzureEventHub.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public class RemoveAzureEventHub : AzureEventHubsCmdletBase
4545
public override void ExecuteCmdlet()
4646
{
4747
// delete a EventHub
48-
bool deleteHub = Client.DeleteEventHub(ResourceGroupName, NamespaceName, EventHubName);
49-
WriteObject(deleteHub);
48+
if(ShouldProcess(target:EventHubName, action:string.Format("Deleting EventHub: {0} of NnameSpace{1}",EventHubName,NamespaceName)))
49+
{
50+
WriteObject(Client.DeleteEventHub(ResourceGroupName, NamespaceName, EventHubName));
51+
}
5052
}
5153
}
5254
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/RemoveAzureEventHubAuthorizationRules.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ public class RemoveAzureEventHubAuthorizationRule : AzureEventHubsCmdletBase
5353
public override void ExecuteCmdlet()
5454
{
5555
// Delete EventHub authorizationRule
56-
bool deleteAuthRule = Client.DeleteEventHubAuthorizationRules(ResourceGroupName, NamespaceName, EventHubName, AuthorizationRuleName);
57-
WriteObject(deleteAuthRule);
56+
if (ShouldProcess(target: AuthorizationRuleName, action: string.Format("Deleting AtuhorizationRule:{0} from Eventhub:{1} of Namespace: {2}", AuthorizationRuleName, EventHubName, NamespaceName)))
57+
{
58+
WriteObject(Client.DeleteEventHubAuthorizationRules(ResourceGroupName, NamespaceName, EventHubName, AuthorizationRuleName));
59+
}
5860
}
5961
}
6062
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/SetAzureEventHub.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ public override void ExecuteCmdlet()
8383
if (partitionCount.HasValue)
8484
eventHub.PartitionCount = partitionCount;
8585
}
86-
87-
EventHubAttributes eventhubAttributes = Client.CreateOrUpdateEventHub(ResourceGroupName, NamespaceName, eventHub.Name, eventHub);
88-
WriteObject(eventhubAttributes);
86+
87+
if(ShouldProcess(target:EventHubName, action: string.Format("Updating EventHub:{0} of NameSpace:{1}",EventHubName,NamespaceName)))
88+
{
89+
WriteObject(Client.CreateOrUpdateEventHub(ResourceGroupName, NamespaceName, eventHub.Name, eventHub));
90+
}
8991
}
9092
}
9193
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/EventHub/SetAzureEventHubAuthorizationRules.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public class SetAzureEventHubAuthorizationRule : AzureEventHubsCmdletBase
6262

6363
[Parameter(Mandatory = false,
6464
ValueFromPipelineByPropertyName = true,
65-
Position = 4,
6665
HelpMessage = "Required if 'AuthruleObj' not specified. Rights - e.g. @(\"Listen\",\"Send\",\"Manage\")")]
6766
[ValidateNotNullOrEmpty]
6867
public string[] Rights { get; set; }
@@ -92,9 +91,10 @@ public override void ExecuteCmdlet()
9291
}
9392

9493
// Update a eventHub authorizationRule
95-
SharedAccessAuthorizationRuleAttributes authRule = Client.CreateOrUpdateEventHubAuthorizationRules(ResourceGroupName, NamespaceName, EventHubName,
96-
sasRule.Name, sasRule);
97-
WriteObject(authRule);
94+
if (ShouldProcess(target: AuthorizationRuleName, action: string.Format("Update AuthorizationRule:{0} of Eventhub:{1} of NameSpace:{2}", AuthorizationRuleName, EventHubName, NamespaceName)))
95+
{
96+
WriteObject(Client.CreateOrUpdateEventHubAuthorizationRules(ResourceGroupName, NamespaceName, EventHubName, sasRule.Name, sasRule));
97+
}
9898
}
9999
}
100100
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/NewAzureEventHubNameSpaceKey.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,18 @@ public class NewAzureRmEventHubNamespaceKey : AzureEventHubsCmdletBase
5252
HelpMessage = "Regenerate Keys - 'PrimaryKey'/'SecondaryKey'.")]
5353
[ValidateSet(RegeneKeys.PrimaryKey,
5454
RegeneKeys.SecondaryKey,
55-
IgnoreCase = true)]
56-
[ValidateNotNullOrEmpty]
55+
IgnoreCase = true)]
5756
public string RegenerateKeys { get; set; }
5857

5958
public override void ExecuteCmdlet()
6059
{
6160
var regenKey = new RegenerateKeysParameters(ParsePolicyKey(RegenerateKeys));
6261

6362
// Get a EventHub List Keys for the specified AuthorizationRule
64-
ListKeysAttributes keys = Client.SetRegenerateKeys(ResourceGroup, NamespaceName, AuthorizationRuleName, RegenerateKeys);
65-
WriteObject(keys);
63+
if (ShouldProcess(target: RegenerateKeys, action: string.Format("Generating Key:{0} for AuthorizationRule:{1} of NameSpace:{2}", RegenerateKeys, AuthorizationRuleName, NamespaceName)))
64+
{
65+
WriteObject(Client.SetRegenerateKeys(ResourceGroup, NamespaceName, AuthorizationRuleName, RegenerateKeys));
66+
}
6667
}
6768
}
6869
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/NewAzureEventHubNamespace.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ public override void ExecuteCmdlet()
9898
{
9999
// Create a new EventHub namespaces
100100
Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);
101-
NamespaceAttributes nsAttribute = Client.BeginCreateNamespace(ResourceGroupName, NamespaceName, Location, SkuName, SkuCapacity, tagDictionary);
102-
WriteObject(nsAttribute);
101+
if (ShouldProcess(target: NamespaceName, action: string.Format("Create a new EvetntHub-Namespace:{0} under Resource Group:{1}", NamespaceName, ResourceGroupName)))
102+
{
103+
WriteObject(Client.BeginCreateNamespace(ResourceGroupName, NamespaceName, Location, SkuName, SkuCapacity, tagDictionary));
104+
}
103105
}
104106
}
105107
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/NewAzureEventHubNamespaceAuthorizationRules.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ public override void ExecuteCmdlet()
7070
sasRule.Location = getNamespace.Location;
7171

7272
// Create a new eventHub authorizationRule
73-
SharedAccessAuthorizationRuleAttributes authRule = Client.CreateOrUpdateNamespaceAuthorizationRules(ResourceGroupName, NamespaceName, sasRule.Name, sasRule);
74-
WriteObject(authRule);
73+
if (ShouldProcess(target: AuthorizationRuleName, action: string.Format("Create new AuthorizationRule: {0} for NameSpace:{1}", AuthorizationRuleName, NamespaceName)))
74+
{
75+
WriteObject(Client.CreateOrUpdateNamespaceAuthorizationRules(ResourceGroupName, NamespaceName, sasRule.Name, sasRule));
76+
}
7577
}
7678
}
7779
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/RemoveAzureEventHubNamespace.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public class RemoveAzureRmEventHubNamespace : AzureEventHubsCmdletBase
3939
public override void ExecuteCmdlet()
4040
{
4141
// delete a EventHub namespace
42-
Client.BeginDeleteNamespace(ResourceGroupName, NamespaceName);
42+
if(ShouldProcess(target:NamespaceName,action:string.Format("Delete NameSpace:{0} from ResourceGroup:{1}",NamespaceName,ResourceGroupName)))
43+
{
44+
Client.BeginDeleteNamespace(ResourceGroupName, NamespaceName);
45+
}
4346
}
4447
}
4548
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/RemoveAzureEventHubNamespaceAuthorizationRules.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public class RemoveAzureRmEventHubNamespaceAuthorizationRule : AzureEventHubsCmd
4646
public override void ExecuteCmdlet()
4747
{
4848
// Create a new EventHub namespace authorizationRule
49-
bool deleteAuthRule = Client.DeleteNamespaceAuthorizationRules(ResourceGroupName, NamespaceName, AuthorizationRuleName);
50-
WriteObject(deleteAuthRule);
49+
if (ShouldProcess(target: AuthorizationRuleName, action: string.Format("Delete AuthorizationRule:{0} of NameSpace:{1}", AuthorizationRuleName, NamespaceName)))
50+
{
51+
WriteObject(Client.DeleteNamespaceAuthorizationRules(ResourceGroupName, NamespaceName, AuthorizationRuleName));
52+
}
5153
}
5254
}
5355
}

src/ResourceManager/EventHub/Commands.EventHub/Cmdlets/Namespace/SetAzureEventHubNamespace.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ public class SetAzureEventHubNamespace : AzureEventHubsCmdletBase
7676
public override void ExecuteCmdlet()
7777
{
7878
// Update a EventHub namespace
79-
Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);
80-
NamespaceAttributes nsAttribute = Client.UpdateNamespace(ResourceGroupName, NamespaceName, Location, SkuName, SkuCapacity, State, tagDictionary);
81-
WriteObject(nsAttribute);
79+
Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);
80+
81+
if (ShouldProcess(target: NamespaceName, action: string.Format("Update NameSpace:{0} from ResourceGroup:{1}", NamespaceName, ResourceGroupName)))
82+
{
83+
WriteObject(Client.UpdateNamespace(ResourceGroupName, NamespaceName, Location, SkuName, SkuCapacity, State, tagDictionary));
84+
}
8285
}
8386
}
8487
}

0 commit comments

Comments
 (0)