Skip to content

EventHub: RP version 2017-04-01 and cmdlet recommendations #4307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove changes to this file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is an issue with encoding

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the change to this file. This PR will not be accepted until this is completed. Just checkout the previous version of the file, please.

<packageSources>
<add key="local-feed" value="tools/LocalFeed" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="powershell-core" value="https://powershell.myget.org/F/powershell-core/api/v3/index.json" />
</packageSources>
Expand Down
36 changes: 18 additions & 18 deletions src/ResourceManager/EventHub/AzureRM.EventHub.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/14/2017
# Generated on: 7/6/2017
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wre we sure this is up to date?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it up to date.

#

@{
Expand Down Expand Up @@ -72,23 +72,23 @@ NestedModules = @('.\Microsoft.Azure.Commands.EventHub.dll')
FunctionsToExport = @()

# 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.
CmdletsToExport = 'New-AzureRmEventHubKey', 'Get-AzureRmEventHubNamespace',
'Get-AzureRmEventHubNamespaceAuthorizationRule',
'Get-AzureRmEventHubNamespaceKey', 'New-AzureRmEventHubNamespace',
'New-AzureRmEventHubNamespaceAuthorizationRule',
'Remove-AzureRmEventHubNamespace',
'Remove-AzureRmEventHubNamespaceAuthorizationRule',
'Set-AzureRmEventHubNamespace',
'Set-AzureRmEventHubNamespaceAuthorizationRule',
'New-AzureRmEventHubNamespaceKey',
'Get-AzureRmEventHubAuthorizationRule', 'Get-AzureRmEventHubKey',
'Get-AzureRmEventHub', 'New-AzureRmEventHub',
'New-AzureRmEventHubAuthorizationRule', 'Remove-AzureRmEventHub',
'Remove-AzureRmEventHubAuthorizationRule', 'Set-AzureRmEventHub',
'Set-AzureRmEventHubAuthorizationRule',
'Get-AzureRmEventHubConsumerGroup',
'New-AzureRmEventHubConsumerGroup',
'Remove-AzureRmEventHubConsumerGroup',
CmdletsToExport = 'New-AzureRmEventHubKey', 'Get-AzureRmEventHubNamespace',
'Get-AzureRmEventHubNamespaceAuthorizationRule',
'Get-AzureRmEventHubNamespaceKey', 'New-AzureRmEventHubNamespace',
'New-AzureRmEventHubNamespaceAuthorizationRule',
'Remove-AzureRmEventHubNamespace',
'Remove-AzureRmEventHubNamespaceAuthorizationRule',
'Set-AzureRmEventHubNamespace',
'Set-AzureRmEventHubNamespaceAuthorizationRule',
'New-AzureRmEventHubNamespaceKey',
'Get-AzureRmEventHubAuthorizationRule', 'Get-AzureRmEventHubKey',
'Get-AzureRmEventHub', 'New-AzureRmEventHub',
'New-AzureRmEventHubAuthorizationRule', 'Remove-AzureRmEventHub',
'Remove-AzureRmEventHubAuthorizationRule', 'Set-AzureRmEventHub',
'Set-AzureRmEventHubAuthorizationRule',
'Get-AzureRmEventHubConsumerGroup',
'New-AzureRmEventHubConsumerGroup',
'Remove-AzureRmEventHubConsumerGroup',
'Set-AzureRmEventHubConsumerGroup'

# Variables to export from this module
Expand Down
21 changes: 20 additions & 1 deletion src/ResourceManager/EventHub/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,27 @@
-->
## Current Release

## Version 0.4.2
* added ResourceGroup property to NamespaceAttributes
- 'ResourceGroup' Gets the name of the resource group the Namespace is in

* updated commandlets with new parameter and parameter alias
- below cmdlets updated with Parametersets for Namespace and EventHub for operation of AuthorizationRule

- New-AzureRmEventHubAuthorizationRule
- Adds a new AuthorizationRule to the existing NameSpace or EventHub.
- Get-AzureRmEventHubAuthorizationRule
- Gets AuthorizationRule / List of AuthorizationRules for the existing NameSpace or EventHub.
- Set-AzureRmEventHubAuthorizationRule
- Updates properties of existing AuthorizationRule of EventHub NameSpace.
- Remove-AzureRmEventHubAuthorizationRule
- Deletes the existing AuthorizationRule of existing NameSpace or EventHub.
- New-AzureRmEventHubKey
- Generates a new Primary/Secondary Key for AuthorizationRule of existing NameSpace or EventHub.
- Get-AzureRmEventHubKey
- Gets Primary/Secondary Key for AuthorizationRule of existing NameSpace or EventHub.

## Version 0.4.2

## Version 0.4.1

## Version 0.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.EventHub, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.EventHub.1.2.0\lib\net452\Microsoft.Azure.Management.EventHub.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.EventHub, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.EventHub.2.0.0\lib\net452\Microsoft.Azure.Management.EventHub.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.28.3.860, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
Expand All @@ -66,11 +67,12 @@
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.6\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.8\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.5\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.7\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.12\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
Expand Down Expand Up @@ -166,29 +168,47 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\ConsumerGroupsTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\NamespaceTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\EventHubsTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests\ConsumerGroupsCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests\ConsumerGroupsCRUD_New.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsAuthorizationRulesCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsAuthorizationRulesCRUD_New.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsAuthorizationRules_NewCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests\EventHubsCRUD_New.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceAuthorizationRulesCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceAuthorizationRulesCRUD_New.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests\NamespaceCRUD_New.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,14 @@ public void ConsumerGroupsCRUD()
{
EventHubsController.NewInstance.RunPsTest("ConsumerGroupsTests");
}


[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void ConsumerGroupsCRUD_New()
{
EventHubsController.NewInstance.RunPsTest("ConsumerGroupsTests_New");
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Get-NamespaceName

<#
.SYNOPSIS
Tests EventHub Namespace Create List Remove operations.
Tests ConsumerGroup Create List Remove operations.
#>
function ConsumerGroupsTests
{ # Setup
Expand All @@ -69,8 +69,7 @@ function ConsumerGroupsTests
Write-Debug " Create new Evnethub namespace"
Write-Debug " Namespace name : $namespaceName"
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName -Location $location
Wait-Seconds 15


Write-Debug " Get the created namespace within the resource group"
$createdNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName

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

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

# Cleanup
Write-Debug " Delete created ConsumerGroup "
Expand All @@ -106,6 +105,68 @@ function ConsumerGroupsTests
Write-Debug " Delete namespaces"
Remove-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -NamespaceName $namespaceName

Write-Debug " Delete resourcegroup"
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
}


<#
.SYNOPSIS
Tests New Parameter for ConsumerGroup Create List Remove operations.
#>
function ConsumerGroupsTests_New
{ # Setup


$location = Get-Location
$resourceGroupName = Get-ResourceGroupName
$namespaceName = Get-NamespaceName
$eventHubName = Get-EventHubName
$consumerGroupName = Get-ConsumerGroupName

Write-Debug " Create resource group"
Write-Debug " Resource Group Name : $resourceGroupName"
$Result11 = New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -Force

Write-Debug " Create new Evnethub namespace"
Write-Debug " Namespace name : $namespaceName"
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName -Location $location

Write-Debug " Get the created namespace within the resource group"
$createdNamespace = Get-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName

Assert-True {$createdNamespace.Name -eq $namespaceName} "Namespace created earlier is not found."

Write-Debug " Create new eventHub "
$msgRetentionInDays = 3
$partionCount = 2
$result = New-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -Name $eventHubName -MessageRetentionInDays $msgRetentionInDays -PartitionCount $partionCount

Write-Debug " Get the created eventHub "
$createdEventHub = Get-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $result.Name

$createdEventHub = Get-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $eventHubName
Assert-True {$createdEventHub.Name -eq $eventHubName} "Namespace created earlier is not found."

Write-Debug " Create a new ConsumerGroup "
$result_ConsumerGroup = New-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $eventHubName -Name $consumerGroupName

Write-Debug " Get created ConsumerGroup "
$CreatedConsumerGroup = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $eventHubName -Name $result_ConsumerGroup.Name

Write-Debug " Get all created ConsumerGroup "
$CreatedConsumerGroups = Get-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $result.Name

# Cleanup
Write-Debug " Delete created ConsumerGroup "
Remove-AzureRmEventHubConsumerGroup -ResourceGroup $resourceGroupName -Namespace $namespaceName -EventHub $result.Name -Name $CreatedConsumerGroup.Name

Write-Debug " Delete the EventHub"
$delete1 = Remove-AzureRmEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $result.Name

Write-Debug " Delete namespaces"
Remove-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName

Write-Debug " Delete resourcegroup"
Remove-AzureRmResourceGroup -Name $resourceGroupName -Force
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,25 @@ public void EventHubsCRUD()
EventHubsController.NewInstance.RunPsTest("EventHubsTests");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void EventHubsCRUD_New()
{
EventHubsController.NewInstance.RunPsTest("EventHubsTests_New");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void EventHubsAuthorizationRulesCRUD()
{
EventHubsController.NewInstance.RunPsTest("EventHubsAuthTests");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void EventHubsAuthorizationRulesCRUD_New()
{
EventHubsController.NewInstance.RunPsTest("EventHubsAuth_NewTests");
}
}
}
Loading