Skip to content

Commit 74947e0

Browse files
authored
Fix ChinaCDN related pricing SKU display (#11517)
1 parent dd75697 commit 74947e0

File tree

5 files changed

+149
-2
lines changed

5 files changed

+149
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
19+
namespace Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest
20+
{
21+
public class ChinaCdnProfileTests
22+
{
23+
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;
24+
25+
public ChinaCdnProfileTests(Xunit.Abstractions.ITestOutputHelper output)
26+
{
27+
_logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
28+
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
29+
}
30+
31+
[Fact]
32+
[Trait(Category.AcceptanceType, Category.CheckIn)]
33+
public void TestProfileList()
34+
{
35+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ProfileList");
36+
}
37+
}
38+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Create Profile with different Sku
18+
#>
19+
function Test-ProfileList
20+
{
21+
$retrievedProfile = Get-AzCdnProfile -ProfileName "cdn-billing-standard-bandwidth-avg" -ResourceGroupName "cdnbillingskus"
22+
23+
Assert-NotNull $retrievedProfile
24+
Assert-AreEqual "Standard_AvgBandWidth_ChinaCdn" $retrievedProfile.Sku.Name
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "/subscriptions/b7f584b1-4c44-4a5c-a3c9-9f85d925d727/resourceGroups/cdnbillingskus/providers/Microsoft.Cdn/profiles/cdn-billing-standard-bandwidth-avg?api-version=2019-04-15",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjdmNTg0YjEtNGM0NC00YTVjLWEzYzktOWY4NWQ5MjVkNzI3L3Jlc291cmNlR3JvdXBzL2NkbmJpbGxpbmdza3VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ2RuL3Byb2ZpbGVzL2Nkbi1iaWxsaW5nLXN0YW5kYXJkLWJhbmR3aWR0aC1hdmc/YXBpLXZlcnNpb249MjAxOS0wNC0xNQ==",
6+
"RequestMethod": "GET",
7+
"RequestBody": "",
8+
"RequestHeaders": {
9+
"x-ms-client-request-id": [
10+
"d68775c5-2b20-4c60-ac0d-05e92da230f5"
11+
],
12+
"Accept-Language": [
13+
"en-US"
14+
],
15+
"User-Agent": [
16+
"FxVersion/4.6.28207.03",
17+
"OSName/Windows",
18+
"OSVersion/Microsoft.Windows.10.0.18363.",
19+
"Microsoft.Azure.Management.Cdn.CdnManagementClient/4.2.4.0"
20+
]
21+
},
22+
"ResponseHeaders": {
23+
"Cache-Control": [
24+
"no-cache"
25+
],
26+
"Pragma": [
27+
"no-cache"
28+
],
29+
"x-ms-ratelimit-remaining-subscription-reads": [
30+
"14999"
31+
],
32+
"Strict-Transport-Security": [
33+
"max-age=31536000; includeSubDomains"
34+
],
35+
"x-ms-request-id": [
36+
"367b9dc8-a107-48f9-b70e-210c0e7fac25"
37+
],
38+
"x-ms-client-request-id": [
39+
"d68775c5-2b20-4c60-ac0d-05e92da230f5"
40+
],
41+
"OData-Version": [
42+
"4.0"
43+
],
44+
"Server": [
45+
"Kestrel"
46+
],
47+
"x-ms-correlation-request-id": [
48+
"a6b5b77b-ff2a-4329-afe9-f630b11199df"
49+
],
50+
"x-ms-routing-request-id": [
51+
"CHINAEAST:20200407T085414Z:a6b5b77b-ff2a-4329-afe9-f630b11199df"
52+
],
53+
"X-Content-Type-Options": [
54+
"nosniff"
55+
],
56+
"Date": [
57+
"Tue, 07 Apr 2020 08:54:13 GMT"
58+
],
59+
"Content-Length": [
60+
"388"
61+
],
62+
"Content-Type": [
63+
"application/json; odata.metadata=minimal; odata.streaming=true"
64+
],
65+
"Expires": [
66+
"-1"
67+
]
68+
},
69+
"ResponseBody": "{\r\n \"name\": \"cdn-billing-standard-bandwidth-avg\",\r\n \"id\": \"/subscriptions/b7f584b1-4c44-4a5c-a3c9-9f85d925d727/resourcegroups/cdnbillingskus/providers/Microsoft.Cdn/profiles/cdn-billing-standard-bandwidth-avg\",\r\n \"type\": \"Microsoft.Cdn/profiles\",\r\n \"location\": \"ChinaNorth\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Standard_AvgBandWidth_ChinaCdn\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceState\": \"Active\"\r\n }\r\n}",
70+
"StatusCode": 200
71+
}
72+
],
73+
"Names": {},
74+
"Variables": {
75+
"SubscriptionId": "b7f584b1-4c44-4a5c-a3c9-9f85d925d727"
76+
}
77+
}

src/Cdn/Cdn/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fix ChinaCDN related pricing SKU display
2223

2324
## Version 1.4.2
2425
* Display error response detail in New-AzCdnEndpoint cmdlet

src/Cdn/Cdn/Models/Profile/PSSkuName.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ public enum PSSkuName
2020
Premium_Verizon,
2121
Custom_Verizon,
2222
Standard_Akamai,
23+
Standard_Microsoft,
2324
Standard_ChinaCdn,
24-
Standard_Microsoft
25+
Premium_ChinaCdn,
26+
Standard_955BandWidth_ChinaCdn,
27+
Standard_AvgBandWidth_ChinaCdn,
28+
StandardPlus_ChinaCdn,
29+
StandardPlus_955BandWidth_ChinaCdn,
30+
StandardPlus_AvgBandWidth_ChinaCdn,
2531
}
26-
}
32+
}

0 commit comments

Comments
 (0)