Skip to content

Commit aa640d5

Browse files
authored
Merge pull request #3981 from amolr/preview
Updating Powershell SDK to include the HTTP APNS 2 changes
2 parents 8e5f047 + 9b5eb6f commit aa640d5

File tree

10 files changed

+156728
-18701
lines changed

10 files changed

+156728
-18701
lines changed

setup/azurecmdfiles.wxi

Lines changed: 0 additions & 192 deletions
Large diffs are not rendered by default.

src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/Commands.NotificationHubs.Test.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
7676
</Reference>
7777
<Reference Include="Microsoft.Azure.Management.NotificationHubs, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
78-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.NotificationHubs.2.1.0-preview\lib\net45\Microsoft.Azure.Management.NotificationHubs.dll</HintPath>
78+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.NotificationHubs.2.3.1-preview\lib\net452\Microsoft.Azure.Management.NotificationHubs.dll</HintPath>
7979
<Private>True</Private>
8080
</Reference>
8181
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -97,11 +97,11 @@
9797
<Private>True</Private>
9898
</Reference>
9999
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
100-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.5\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
100+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.8\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
101101
<Private>True</Private>
102102
</Reference>
103103
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
104-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.5\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
104+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.7\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
105105
<Private>True</Private>
106106
</Reference>
107107
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/ScenarioTests/NHServiceTests.ps1

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,24 @@ function Test-CRUDNotificationHub
435435
$createdNotificationHub.WnsCredential.PackageSid = "ms-app://s-1-15-2-1817505189-427745171-3213743798-2985869298-800724128-1004923984-4143860699"
436436
$createdNotificationHub.WnsCredential.SecretKey = "w7TBprR-9tJxn9mUOdK4PPHLCAzSYFhp"
437437
$createdNotificationHub.WnsCredential.WindowsLiveEndpoint = "http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf"
438+
$createdNotificationHub.ApnsCredential = New-Object 'Microsoft.Azure.Management.NotificationHubs.Models.ApnsCredential'
439+
$createdNotificationHub.ApnsCredential.KeyId = "TXRXD9P6K7"
440+
$createdNotificationHub.ApnsCredential.Token = "MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgpVB15km4qskA5Ra5XvdtOwWPvaXIhVVQZdonzINh+hGgCgYIKoZIzj0DAQehRANCAASS3ek04J20BqA6WWDlD6+xd3dJEifhW87wI0nnkfUB8LDb424TiWlzGIgnxV79hb3QHCAUNsPdBfLLF+Od8yqL"
441+
$createdNotificationHub.ApnsCredential.AppName = "Sample"
442+
$createdNotificationHub.ApnsCredential.AppId = "EF9WEB9D5K"
443+
$createdNotificationHub.ApnsCredential.Endpoint = "https://api.push.apple.com:443/3/device"
438444
$result = New-AzureRmNotificationHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -NotificationHubObj $createdNotificationHub
439445

440446
Write-Debug " Get the PNS credentials for the second notificationHub created"
441447
$pnsCredentials = Get-AzureRmNotificationHubPNSCredentials -ResourceGroup $resourceGroupName -Namespace $namespaceName -NotificationHub $notificationHubName2
442448
Assert-AreEqual $createdNotificationHub.WnsCredential.PackageSid $pnsCredentials.WnsCredential.PackageSid
443449
Assert-AreEqual $createdNotificationHub.WnsCredential.SecretKey $pnsCredentials.WnsCredential.SecretKey
444450
Assert-AreEqual $createdNotificationHub.WnsCredential.WindowsLiveEndpoint $pnsCredentials.WnsCredential.WindowsLiveEndpoint
445-
451+
Assert-AreEqual $createdNotificationHub.ApnsCredential.KeyId $pnsCredentials.ApnsCredential.KeyId
452+
Assert-AreEqual $createdNotificationHub.ApnsCredential.Token $pnsCredentials.ApnsCredential.Token
453+
Assert-AreEqual $createdNotificationHub.ApnsCredential.AppName $pnsCredentials.ApnsCredential.AppName
454+
Assert-AreEqual $createdNotificationHub.ApnsCredential.AppId $pnsCredentials.ApnsCredential.AppId
455+
Assert-AreEqual $createdNotificationHub.ApnsCredential.Endpoint $pnsCredentials.ApnsCredential.Endpoint
446456
Write-Debug " Get all the created notificationHub "
447457
$createdNotificationHubList = Get-AzureRmNotificationHub -ResourceGroup $resourceGroupName -Namespace $namespaceName
448458

@@ -468,7 +478,13 @@ function Test-CRUDNotificationHub
468478
$createdNotificationHub.WnsCredential = New-Object 'Microsoft.Azure.Management.NotificationHubs.Models.WnsCredential'
469479
$createdNotificationHub.WnsCredential.PackageSid = "ms-app://s-1-15-2-1817505189-427745171-3213743798-2985869298-800724128-1004923984-4143860699"
470480
$createdNotificationHub.WnsCredential.SecretKey = "w7TBprR-9tJxn9mUOdK4PPHLCAzSYFhp"
481+
$createdNotificationHub.ApnsCredential.KeyId = "TXRXD9P6K7"
482+
$createdNotificationHub.ApnsCredential.Token = "MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgpVB15km4qskA5Ra5XvdtOwWPvaXIhVVQZdonzINh+hGgCgYIKoZIzj0DAQehRANCAASS3ek04J20BqA6WWDlD6+xd3dJEifhW87wI0nnkfUB8LDb424TiWlzGIgnxV79hb3QHCAUNsPdBfLLF+Od8yqL"
483+
$createdNotificationHub.ApnsCredential.AppName = "Sample2"
484+
$createdNotificationHub.ApnsCredential.AppId = "EF9WEB9D5K"
485+
$createdNotificationHub.ApnsCredential.Endpoint = "https://api.push.apple.com:443/3/device"
471486
$createdNotificationHub.WnsCredential.WindowsLiveEndpoint = "http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf"
487+
472488
$result = Set-AzureRmNotificationHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -NotificationHubObj $createdNotificationHub -Force
473489
if($env:AZURE_TEST_MODE -ne "Playback")
474490
{
@@ -480,6 +496,11 @@ function Test-CRUDNotificationHub
480496
Assert-AreEqual $createdNotificationHub.WnsCredential.PackageSid $pnsCredentials.WnsCredential.PackageSid
481497
Assert-AreEqual $createdNotificationHub.WnsCredential.SecretKey $pnsCredentials.WnsCredential.SecretKey
482498
Assert-AreEqual $createdNotificationHub.WnsCredential.WindowsLiveEndpoint $pnsCredentials.WnsCredential.WindowsLiveEndpoint
499+
Assert-AreEqual $createdNotificationHub.ApnsCredential.KeyId $pnsCredentials.ApnsCredential.KeyId
500+
Assert-AreEqual $createdNotificationHub.ApnsCredential.Token $pnsCredentials.ApnsCredential.Token
501+
Assert-AreEqual $createdNotificationHub.ApnsCredential.AppName $pnsCredentials.ApnsCredential.AppName
502+
Assert-AreEqual $createdNotificationHub.ApnsCredential.AppId $pnsCredentials.ApnsCredential.AppId
503+
Assert-AreEqual $createdNotificationHub.ApnsCredential.Endpoint $pnsCredentials.ApnsCredential.Endpoint
483504

484505
#Test NotificationHub creation with tags as null
485506
$result = New-AzureRmNotificationHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -InputFile .\Resources\NewNotificationHubNoTags.json

0 commit comments

Comments
 (0)