Skip to content

Azure powershell SDK changes for Notification Hubs. Added a skuTier parameter for create/update namespace. #3119

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 2 commits into from
Nov 23, 2016
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
18 changes: 11 additions & 7 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,8 @@
<Component Id="cmpFC33C3BBB9DE3FDA41AAC3F0C1652F45" Guid="*">
<File Id="fil0BC58752DC9792178625EA842D496953" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
</Component>
<Component Id="cmpDE07060F7C404EB0947D0711C6A05ABA" Guid="*">
<File Id="fil7F437FF8C0784CA7B8438C683AE09BC4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.dll" />
<Component Id="cmpE389288C5CA88334DBFAA1A298DFDC57" Guid="*">
<File Id="fil3D9EA2F20E6C186138C8614E1378739F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.dll" />
</Component>
<Component Id="cmpE0A4360ECC0B00A74E3D29F280B2FD2E" Guid="*">
<File Id="fil1FB9B7667782F24EAC7BB0B862A44410" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.dll" />
Expand Down Expand Up @@ -1949,6 +1949,9 @@
<Component Id="cmp02101C8205A10465A009DD2D2D0F1390" Guid="*">
<File Id="fil4CA8F0CA63F798A22950895A16A78B18" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.NotificationHubs\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
</Component>
<Component Id="cmp0D0D795C52AF8527E2B92C491C447906" Guid="*">
<File Id="filD8614F896FBB93824122EB840C9A88F0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.NotificationHubs\Microsoft.Rest.ClientRuntime.Azure.dll" />
</Component>
<Component Id="cmp70EF4B668BAC168FD29981CF127B86C5" Guid="*">
<File Id="fil624F3BFD8FC0BFE924EF19BDF7C3C26B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.NotificationHubs\Microsoft.Rest.ClientRuntime.dll" />
</Component>
Expand Down Expand Up @@ -1978,9 +1981,6 @@
<Component Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" Guid="*">
<File Id="filF30732FD3174ABEC7D2103467F25E8E5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\AzureRM.OperationalInsights.psd1" />
</Component>
<Component Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" Guid="*">
<File Id="filD2FB04719F134FB9BF2BC1EE41908381" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
</Component>
<Component Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" Guid="*">
<File Id="filD490745C6F4007A53448F93D7655F3D4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Hyak.Common.dll" />
</Component>
Expand Down Expand Up @@ -2044,6 +2044,9 @@
<Component Id="cmpFD405A18E2A1C755986CD15E7976CCD9" Guid="*">
<File Id="filD7B6812AB9810AD6C0DE6904B4262D96" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmpD40FCB9017580E2042019CEA18C95507" Guid="*">
<File Id="fil2725AD41AD388A79C41F93ADF90AADE3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
</Component>
<Component Id="cmpD895804B1147D0DB74C81C5C228D8CFA" Guid="*">
<File Id="filA2326E206A682358A6CBA550FA21A25E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\System.Net.Http.Extensions.dll" />
</Component>
Expand Down Expand Up @@ -5953,7 +5956,7 @@
<ComponentRef Id="cmp95FB8932F45A41F4AF974FB6F565B75C" />
<ComponentRef Id="cmpC9466F4B506234EBA66C4F1204C0CD5D" />
<ComponentRef Id="cmpFC33C3BBB9DE3FDA41AAC3F0C1652F45" />
<ComponentRef Id="cmpDE07060F7C404EB0947D0711C6A05ABA" />
<ComponentRef Id="cmpE389288C5CA88334DBFAA1A298DFDC57" />
<ComponentRef Id="cmpE0A4360ECC0B00A74E3D29F280B2FD2E" />
<ComponentRef Id="cmpE2B4EA9CCA75508B10345C79226A99BF" />
<ComponentRef Id="cmp545597FAE11FE5F91F4BDCD56D1DFE83" />
Expand Down Expand Up @@ -6150,6 +6153,7 @@
<ComponentRef Id="cmp00A626BF687C0B839638474C372F830C" />
<ComponentRef Id="cmp775CB6B7D1F3AD4D55497F602D74AECF" />
<ComponentRef Id="cmp02101C8205A10465A009DD2D2D0F1390" />
<ComponentRef Id="cmp0D0D795C52AF8527E2B92C491C447906" />
<ComponentRef Id="cmp70EF4B668BAC168FD29981CF127B86C5" />
<ComponentRef Id="cmpB094102F26151D0A1F6097A8CEE8CF40" />
<ComponentRef Id="cmpE727598EA987F9F9AC37355BE178AE99" />
Expand All @@ -6159,7 +6163,6 @@
<ComponentRef Id="cmp275E5D23204FF3DB5A484691FFA2C6F5" />
<ComponentRef Id="cmp5E9A44B7330C75772463CB17D6D24AA6" />
<ComponentRef Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" />
<ComponentRef Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" />
<ComponentRef Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" />
<ComponentRef Id="cmp6D68CAF3787D43356F3C2CB592699D2D" />
<ComponentRef Id="cmp20FBC1203D91D529F69E519C9C2F78B8" />
Expand All @@ -6181,6 +6184,7 @@
<ComponentRef Id="cmp6B49CE5195722BC055BE51FA1070592A" />
<ComponentRef Id="cmpF98A2CCD736EDBCB2C21E170C3EB8FC9" />
<ComponentRef Id="cmpFD405A18E2A1C755986CD15E7976CCD9" />
<ComponentRef Id="cmpD40FCB9017580E2042019CEA18C95507" />
<ComponentRef Id="cmpD895804B1147D0DB74C81C5C228D8CFA" />
<ComponentRef Id="cmpBBEEE168902DFD205E35F47468881929" />
<ComponentRef Id="cmp07ACD4A07ADD8A358045C237522DA4C4" />
Expand Down
6 changes: 5 additions & 1 deletion src/ResourceManager/NotificationHubs/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
- Additional information about change #1
-->
## Current Release
* Added the skuTier parameter to set the sky for namespace
- New-AzureRmNotificationHubsNamespace
- Set-AzureRmNotificationHubsNamespace

## Version 2.3.0
* New cmdlets
- New-AzureRmNotificationHubKey
- New-AzureRmNotificationHubsNamespaceKey
- New-AzureRmNotificationHubsNamespaceKey

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.NotificationHubs, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.NotificationHubs.2.0.0-preview\lib\net45\Microsoft.Azure.Management.NotificationHubs.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.NotificationHubs.2.1.0-preview\lib\net45\Microsoft.Azure.Management.NotificationHubs.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ function Test-CRUDNamespace
{
# Setup
$location = "South Central US"
$skuTier = "Basic"
Write-Debug "Create resource group"
$resourceGroupName = Get-ResourceGroupName
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -Force
Write-Debug "ResourceGroup name : $resourceGroupName"

$namespaceName = Get-NamespaceName

Write-Debug " Create new notificationHub namespace"
Write-Debug "NamespaceName : $namespaceName"
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier

if($env:AZURE_TEST_MODE -ne "Playback")
{
Is-NamespaceActive $resourceGroupName $namespaceName
Expand All @@ -102,12 +102,13 @@ function Test-CRUDNamespace
$found = 1
Assert-AreEqual $location $createdNamespace[$i].Location
Assert-AreEqual "NotificationHub" $createdNamespace[$i].NamespaceType
Assert-AreEqual "Basic" $createdNamespace[$i].SkuName
break
}
}

Assert-True {$found -eq 1} "Namespace created earlier is not found."

Write-Debug "Create one more resource group"
$secondResourceGroup = Get-ResourceGroupName
Write-Debug "ResourceGroup name : $secondResourceGroup"
Expand Down Expand Up @@ -135,6 +136,7 @@ function Test-CRUDNamespace
Assert-AreEqual $location $allCreatedNamespace[$i].Location
Assert-AreEqual $secondResourceGroup $allCreatedNamespace[$i].ResourceGroupName
Assert-AreEqual "NotificationHub" $allCreatedNamespace[$i].NamespaceType
Assert-AreEqual "Free" $allCreatedNamespace[$i].SkuName
break
}
}
Expand Down Expand Up @@ -169,11 +171,12 @@ function Test-CRUDNamespace
Write-Debug " Update an existing namespace"
$tags = @{"tag1" = "value1" ; "tag2" = "value2"}
Write-Debug "Tags List : $tags"
$skuTier = "Standard"

$updatedNamespace = Set-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2 -Location $location -Tags $tags -Force
$updatedNamespace = Set-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2 -Location $location -Tags $tags -skuTier $skuTier -Force
Assert-AreEqual 2 $updatedNamespace.Tags.Count
if($env:AZURE_TEST_MODE -ne "Playback")

if($env:AZURE_TEST_MODE -ne "Playback")
{
Wait-Seconds 15
}
Expand All @@ -182,6 +185,7 @@ function Test-CRUDNamespace
$getUpdatedNamespace = Get-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2
#uncomment once the playback mode doesnt fail on this
#Assert-AreEqual $updatedNamespace.Tags.Count $getUpdatedNamespace.Tags.Count
Assert-AreEqual "Standard" $updatedNamespace.SkuName

Write-Debug " Delete namespaces"
Remove-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2 -Force
Expand All @@ -200,6 +204,7 @@ function Test-CRUDNamespaceAuth
{
# Setup
$location = "South Central US"
$skuTier = "Basic"

Write-Debug " Create resource group"
$resourceGroupName = Get-ResourceGroupName
Expand All @@ -211,7 +216,7 @@ function Test-CRUDNamespaceAuth
Write-Debug " Create new notificationHub namespace"
Write-Debug "Namespace name : $namespaceName"

$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
if($env:AZURE_TEST_MODE -ne "Playback")
{
Is-NamespaceActive $resourceGroupName $namespaceName
Expand Down Expand Up @@ -378,7 +383,7 @@ function Test-CRUDNotificationHub
{
# Setup
$location = "South Central US"
$skuTier = "Basic"
Write-Debug " Create resource group"
$resourceGroupName = Get-ResourceGroupName
Write-Debug " Resource Group Name : $resourceGroupName"
Expand All @@ -388,7 +393,7 @@ function Test-CRUDNotificationHub

Write-Debug " Create new notificationHub namespace"
Write-Debug " Namespace name : $namespaceName"
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
if($env:AZURE_TEST_MODE -ne "Playback")
{
Is-NamespaceActive $resourceGroupName $namespaceName
Expand Down Expand Up @@ -495,7 +500,7 @@ function Test-CRUDNHAuth
{
# Setup
$location = "South Central US"

$skuTier = "Basic"
Write-Debug " Create resource group"
$resourceGroupName = Get-ResourceGroupName
Write-Debug "Resource group name : $resourceGroupName"
Expand All @@ -505,7 +510,7 @@ function Test-CRUDNHAuth

Write-Debug " Create new notificationHub namespace"
Write-Debug "Namespace name : $namespaceName"
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
if($env:AZURE_TEST_MODE -ne "Playback")
{
Is-NamespaceActive $resourceGroupName $namespaceName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ protected TestBaseClass()

protected void SetupManagementClients(MockContext context)
{
var nhManagementClient = GetNotificationHubsManagementClient(context);
var resourceManagementClient = GetResourceManagementClient();
var gallaryClient = GetGalleryClient();
var authorizationManagementClient = GetAuthorizationManagementClient();
var managementClient = GetManagementClient();
var nhManagementClient = GetNotificationHubsManagementClient(context);

helper.SetupManagementClients(nhManagementClient, resourceManagementClient, gallaryClient,
authorizationManagementClient, managementClient);
authorizationManagementClient);
}

protected void RunPowerShellTest(params string[] scripts)
Expand Down
Loading