Skip to content

Commit c09c61c

Browse files
authored
Merge pull request Azure#4307 from v-Ajnava/EHpwr2017
EventHub: RP version 2017-04-01 and cmdlet recommendations
2 parents d804d5f + ea9b657 commit c09c61c

File tree

101 files changed

+428947
-4901
lines changed

Some content is hidden

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

101 files changed

+428947
-4901
lines changed

NuGet.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
44
<add key="local-feed" value="tools/LocalFeed" />
5-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
77
<add key="powershell-core" value="https://powershell.myget.org/F/powershell-core/api/v3/index.json" />
88
</packageSources>

src/ResourceManager/EventHub/AzureRM.EventHub.psd1

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 7/14/2017
6+
# Generated on: 7/6/2017
77
#
88

99
@{
@@ -72,23 +72,23 @@ NestedModules = @('.\Microsoft.Azure.Commands.EventHub.dll')
7272
FunctionsToExport = @()
7373

7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75-
CmdletsToExport = 'New-AzureRmEventHubKey', 'Get-AzureRmEventHubNamespace',
76-
'Get-AzureRmEventHubNamespaceAuthorizationRule',
77-
'Get-AzureRmEventHubNamespaceKey', 'New-AzureRmEventHubNamespace',
78-
'New-AzureRmEventHubNamespaceAuthorizationRule',
79-
'Remove-AzureRmEventHubNamespace',
80-
'Remove-AzureRmEventHubNamespaceAuthorizationRule',
81-
'Set-AzureRmEventHubNamespace',
82-
'Set-AzureRmEventHubNamespaceAuthorizationRule',
83-
'New-AzureRmEventHubNamespaceKey',
84-
'Get-AzureRmEventHubAuthorizationRule', 'Get-AzureRmEventHubKey',
85-
'Get-AzureRmEventHub', 'New-AzureRmEventHub',
86-
'New-AzureRmEventHubAuthorizationRule', 'Remove-AzureRmEventHub',
87-
'Remove-AzureRmEventHubAuthorizationRule', 'Set-AzureRmEventHub',
88-
'Set-AzureRmEventHubAuthorizationRule',
89-
'Get-AzureRmEventHubConsumerGroup',
90-
'New-AzureRmEventHubConsumerGroup',
91-
'Remove-AzureRmEventHubConsumerGroup',
75+
CmdletsToExport = 'New-AzureRmEventHubKey', 'Get-AzureRmEventHubNamespace',
76+
'Get-AzureRmEventHubNamespaceAuthorizationRule',
77+
'Get-AzureRmEventHubNamespaceKey', 'New-AzureRmEventHubNamespace',
78+
'New-AzureRmEventHubNamespaceAuthorizationRule',
79+
'Remove-AzureRmEventHubNamespace',
80+
'Remove-AzureRmEventHubNamespaceAuthorizationRule',
81+
'Set-AzureRmEventHubNamespace',
82+
'Set-AzureRmEventHubNamespaceAuthorizationRule',
83+
'New-AzureRmEventHubNamespaceKey',
84+
'Get-AzureRmEventHubAuthorizationRule', 'Get-AzureRmEventHubKey',
85+
'Get-AzureRmEventHub', 'New-AzureRmEventHub',
86+
'New-AzureRmEventHubAuthorizationRule', 'Remove-AzureRmEventHub',
87+
'Remove-AzureRmEventHubAuthorizationRule', 'Set-AzureRmEventHub',
88+
'Set-AzureRmEventHubAuthorizationRule',
89+
'Get-AzureRmEventHubConsumerGroup',
90+
'New-AzureRmEventHubConsumerGroup',
91+
'Remove-AzureRmEventHubConsumerGroup',
9292
'Set-AzureRmEventHubConsumerGroup'
9393

9494
# Variables to export from this module

src/ResourceManager/EventHub/ChangeLog.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,27 @@
1919
-->
2020
## Current Release
2121

22-
## Version 0.4.2
22+
* added ResourceGroup property to NamespaceAttributes
23+
- 'ResourceGroup' Gets the name of the resource group the Namespace is in
24+
25+
* updated commandlets with new parameter and parameter alias
26+
- below cmdlets updated with Parametersets for Namespace and EventHub for operation of AuthorizationRule
2327

28+
- New-AzureRmEventHubAuthorizationRule
29+
- Adds a new AuthorizationRule to the existing NameSpace or EventHub.
30+
- Get-AzureRmEventHubAuthorizationRule
31+
- Gets AuthorizationRule / List of AuthorizationRules for the existing NameSpace or EventHub.
32+
- Set-AzureRmEventHubAuthorizationRule
33+
- Updates properties of existing AuthorizationRule of EventHub NameSpace.
34+
- Remove-AzureRmEventHubAuthorizationRule
35+
- Deletes the existing AuthorizationRule of existing NameSpace or EventHub.
36+
- New-AzureRmEventHubKey
37+
- Generates a new Primary/Secondary Key for AuthorizationRule of existing NameSpace or EventHub.
38+
- Get-AzureRmEventHubKey
39+
- Gets Primary/Secondary Key for AuthorizationRule of existing NameSpace or EventHub.
40+
41+
## Version 0.4.2
42+
2443
## Version 0.4.1
2544

2645
## Version 0.4.0

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

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
5757
<Private>True</Private>
5858
</Reference>
59-
<Reference Include="Microsoft.Azure.Management.EventHub, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.EventHub.1.2.0\lib\net452\Microsoft.Azure.Management.EventHub.dll</HintPath>
59+
<Reference Include="Microsoft.Azure.Management.EventHub, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.EventHub.2.0.0\lib\net452\Microsoft.Azure.Management.EventHub.dll</HintPath>
61+
<Private>True</Private>
6162
</Reference>
6263
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.28.3.860, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6364
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
@@ -66,11 +67,12 @@
6667
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
6768
</Reference>
6869
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
69-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.6\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
70+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.8\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
71+
<Private>True</Private>
7072
</Reference>
7173
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
72-
<SpecificVersion>False</SpecificVersion>
73-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.5\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
74+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.7\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
75+
<Private>True</Private>
7476
</Reference>
7577
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7678
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.12\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
@@ -166,29 +168,47 @@
166168
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
167169
</None>
168170
<None Include="ScenarioTests\ConsumerGroupsTests.ps1">
169-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
171+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
170172
</None>
171173
<None Include="ScenarioTests\NamespaceTests.ps1">
172-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
174+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
173175
</None>
174176
<None Include="ScenarioTests\EventHubsTests.ps1">
175-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
177+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
176178
</None>
177179
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests\ConsumerGroupsCRUD.json">
178180
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
179181
</None>
182+
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests\ConsumerGroupsCRUD_New.json">
183+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
184+
</None>
180185
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsAuthorizationRulesCRUD.json">
181186
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
182187
</None>
188+
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsAuthorizationRulesCRUD_New.json">
189+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
190+
</None>
191+
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsAuthorizationRules_NewCRUD.json">
192+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
193+
</None>
183194
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsCRUD.json">
184195
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
185196
</None>
197+
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsCRUD_New.json">
198+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
199+
</None>
186200
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceAuthorizationRulesCRUD.json">
187201
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
188202
</None>
203+
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceAuthorizationRulesCRUD_New.json">
204+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
205+
</None>
189206
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceCRUD.json">
190207
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
191208
</None>
209+
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceCRUD_New.json">
210+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
211+
</None>
192212
</ItemGroup>
193213
<ItemGroup>
194214
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj">

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,14 @@ public void ConsumerGroupsCRUD()
3434
{
3535
EventHubsController.NewInstance.RunPsTest("ConsumerGroupsTests");
3636
}
37+
38+
39+
[Fact]
40+
[Trait(Category.AcceptanceType, Category.CheckIn)]
41+
public void ConsumerGroupsCRUD_New()
42+
{
43+
EventHubsController.NewInstance.RunPsTest("ConsumerGroupsTests_New");
44+
}
45+
3746
}
3847
}

src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/ConsumerGroupsTests.ps1

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function Get-NamespaceName
5050

5151
<#
5252
.SYNOPSIS
53-
Tests EventHub Namespace Create List Remove operations.
53+
Tests ConsumerGroup Create List Remove operations.
5454
#>
5555
function ConsumerGroupsTests
5656
{ # Setup
@@ -69,8 +69,7 @@ function ConsumerGroupsTests
6969
Write-Debug " Create new Evnethub namespace"
7070
Write-Debug " Namespace name : $namespaceName"
7171
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -Location $location
72-
Wait-Seconds 15
73-
72+
7473
Write-Debug " Get the created namespace within the resource group"
7574
$createdNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName
7675

@@ -94,7 +93,7 @@ function ConsumerGroupsTests
9493
$CreatedConsumerGroup = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -EventHubName $eventHubName -ConsumerGroupName $result_ConsumerGroup.Name
9594

9695
Write-Debug " Get all created ConsumerGroup "
97-
$CreatedConsumerGroups = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -EventHubName $result.Name
96+
$CreatedConsumerGroups = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -EventHubName $eventHubName
9897

9998
# Cleanup
10099
Write-Debug " Delete created ConsumerGroup "
@@ -106,6 +105,68 @@ function ConsumerGroupsTests
106105
Write-Debug " Delete namespaces"
107106
Remove-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName
108107

108+
Write-Debug " Delete resourcegroup"
109+
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
110+
}
111+
112+
113+
<#
114+
.SYNOPSIS
115+
Tests New Parameter for ConsumerGroup Create List Remove operations.
116+
#>
117+
function ConsumerGroupsTests_New
118+
{ # Setup
119+
120+
121+
$location = Get-Location
122+
$resourceGroupName = Get-ResourceGroupName
123+
$namespaceName = Get-NamespaceName
124+
$eventHubName = Get-EventHubName
125+
$consumerGroupName = Get-ConsumerGroupName
126+
127+
Write-Debug " Create resource group"
128+
Write-Debug " Resource Group Name : $resourceGroupName"
129+
$Result11 = New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -Force
130+
131+
Write-Debug " Create new Evnethub namespace"
132+
Write-Debug " Namespace name : $namespaceName"
133+
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName -Location $location
134+
135+
Write-Debug " Get the created namespace within the resource group"
136+
$createdNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName
137+
138+
Assert-True {$createdNamespace.Name -eq $namespaceName} "Namespace created earlier is not found."
139+
140+
Write-Debug " Create new eventHub "
141+
$msgRetentionInDays = 3
142+
$partionCount = 2
143+
$result = New-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -Name $eventHubName -MessageRetentionInDays $msgRetentionInDays -PartitionCount $partionCount
144+
145+
Write-Debug " Get the created eventHub "
146+
$createdEventHub = Get-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $result.Name
147+
148+
$createdEventHub = Get-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $eventHubName
149+
Assert-True {$createdEventHub.Name -eq $eventHubName} "Namespace created earlier is not found."
150+
151+
Write-Debug " Create a new ConsumerGroup "
152+
$result_ConsumerGroup = New-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $eventHubName -Name $consumerGroupName
153+
154+
Write-Debug " Get created ConsumerGroup "
155+
$CreatedConsumerGroup = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $eventHubName -Name $result_ConsumerGroup.Name
156+
157+
Write-Debug " Get all created ConsumerGroup "
158+
$CreatedConsumerGroups = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $result.Name
159+
160+
# Cleanup
161+
Write-Debug " Delete created ConsumerGroup "
162+
Remove-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $result.Name -Name $CreatedConsumerGroup.Name
163+
164+
Write-Debug " Delete the EventHub"
165+
$delete1 = Remove-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $result.Name
166+
167+
Write-Debug " Delete namespaces"
168+
Remove-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName
169+
109170
Write-Debug " Delete resourcegroup"
110171
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
111172
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,25 @@ public void EventHubsCRUD()
3333
EventHubsController.NewInstance.RunPsTest("EventHubsTests");
3434
}
3535

36+
[Fact]
37+
[Trait(Category.AcceptanceType, Category.CheckIn)]
38+
public void EventHubsCRUD_New()
39+
{
40+
EventHubsController.NewInstance.RunPsTest("EventHubsTests_New");
41+
}
42+
3643
[Fact]
3744
[Trait(Category.AcceptanceType, Category.CheckIn)]
3845
public void EventHubsAuthorizationRulesCRUD()
3946
{
4047
EventHubsController.NewInstance.RunPsTest("EventHubsAuthTests");
4148
}
49+
50+
[Fact]
51+
[Trait(Category.AcceptanceType, Category.CheckIn)]
52+
public void EventHubsAuthorizationRulesCRUD_New()
53+
{
54+
EventHubsController.NewInstance.RunPsTest("EventHubsAuth_NewTests");
55+
}
4256
}
4357
}

0 commit comments

Comments
 (0)