Skip to content

Commit 4528e6f

Browse files
authored
Merge branch 'release-2020-03-31' into task-adls-breakingchangebulktransfer
2 parents 31ae693 + 5d696ec commit 4528e6f

25 files changed

+26153
-15
lines changed

src/Support/Support/Az.Support.psd1

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 2/13/2020
6+
# Generated on: 3/24/2020
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.0'
15+
ModuleVersion = '1.0.0'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.6.4'; })
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.7.3'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = 'Microsoft.Azure.Management.Support.dll'
@@ -110,15 +110,7 @@ PrivateData = @{
110110
# IconUri = ''
111111

112112
# ReleaseNotes of this module
113-
ReleaseNotes = '* Preview release of ''Az.Support'' module. Added following cmdlets for creation and management of support tickets.
114-
- Get-AzSupportService
115-
- Get-AzSupportProblemClassification
116-
- New-AzSupportContactProfileObject
117-
- New-AzSupportTicket
118-
- Get-AzSupportTicket
119-
- Update-AzSupportTicket
120-
- New-AzSupportTicketCommunication
121-
- Get-AzSupportTicketCommunication'
113+
ReleaseNotes = '* General availability of ''Az.Support'' module'
122114

123115
# Prerelease string of this module
124116
# Prerelease = ''

src/Support/Support/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
## Upcoming Release
2222

23+
## Version 1.0.0
24+
* General availability of `Az.Support` module
25+
2326
## Version 0.1.0
2427
* Preview release of `Az.Support` module. Added following cmdlets for creation and management of support tickets.
2528
- Get-AzSupportService

src/Support/Support/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
[assembly: ComVisible(false)]
2626
[assembly: CLSCompliant(false)]
2727
[assembly: Guid("22d73af7-38c2-4bf6-b56f-4dc9db05d97a")]
28-
[assembly: AssemblyVersion("0.1.0")]
29-
[assembly: AssemblyFileVersion("0.1.0")]
28+
[assembly: AssemblyVersion("1.0.0")]
29+
[assembly: AssemblyFileVersion("1.0.0")]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
using Microsoft.Azure.ServiceManagement.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19+
using Xunit;
20+
using Xunit.Abstractions;
21+
22+
namespace Microsoft.Azure.Commands.Websites.Test.ScenarioTests
23+
{
24+
public class RoutingRuleTests: RMTestBase
25+
{
26+
public XunitTracingInterceptor _logger;
27+
public RoutingRuleTests(ITestOutputHelper output)
28+
{
29+
_logger = new XunitTracingInterceptor(output);
30+
XunitTracingInterceptor.AddToContext(_logger);
31+
}
32+
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
public void TestAddWebAppTrafficRoutingRule()
36+
{
37+
WebsitesController.NewInstance.RunPsTest(_logger, "Test-AddWebAppTrafficRoutingRule");
38+
}
39+
40+
[Fact]
41+
[Trait(Category.AcceptanceType, Category.CheckIn)]
42+
public void TestRemoveWebAppTrafficRoutingRule()
43+
{
44+
WebsitesController.NewInstance.RunPsTest(_logger, "Test-RemoveWebAppTrafficRoutingRule");
45+
}
46+
47+
[Fact]
48+
[Trait(Category.AcceptanceType, Category.CheckIn)]
49+
public void TestGetWebAppTrafficRoutingRule()
50+
{
51+
WebsitesController.NewInstance.RunPsTest(_logger, "Test-GetWebAppTrafficRoutingRule");
52+
}
53+
54+
[Fact]
55+
[Trait(Category.AcceptanceType, Category.CheckIn)]
56+
public void TestUpdateWebAppTrafficRoutingRule()
57+
{
58+
WebsitesController.NewInstance.RunPsTest(_logger, "Test-UpdateWebAppTrafficRoutingRule");
59+
}
60+
}
61+
}
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
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+
Tests creating a new Routing Rule.
18+
#>
19+
function Test-AddWebAppTrafficRoutingRule
20+
{
21+
# Setup
22+
$ReroutePercentage="15"
23+
$rgname = Get-ResourceGroupName
24+
$appname = Get-WebsiteName
25+
$location = Get-Location
26+
$slotName = "staging"
27+
$planName = Get-WebHostPlanName
28+
$tier = "Standard"
29+
$resourceType = "Microsoft.Web/sites"
30+
try
31+
{
32+
#Setup
33+
New-AzResourceGroup -Name $rgname -Location $location
34+
$serverFarm = New-AzAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier
35+
36+
# Create new web app
37+
$actual = New-AzWebApp -ResourceGroupName $rgname -Name $appname -Location $location -AppServicePlan $planName
38+
39+
# Assert
40+
Assert-AreEqual $appname $actual.Name
41+
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId
42+
43+
# Create deployment slot
44+
$job = New-AzWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotName -AsJob
45+
$job | Wait-Job
46+
$slot = $job | Receive-Job
47+
48+
$appWithSlotName = "$appname/$slotName"
49+
50+
# Assert
51+
Assert-AreEqual $appWithSlotName $slot.Name
52+
Assert-AreEqual $serverFarm.Id $slot.ServerFarmId
53+
54+
#Add Routing Rule for $slot
55+
$rule=Add-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RoutingRule @{ActionHostName=$slot.DefaultHostName;ReroutePercentage=$ReroutePercentage;Name=$slotName}
56+
57+
# Assert
58+
Assert-AreEqual $ReroutePercentage $rule.ReroutePercentage
59+
Assert-AreEqual $slot.DefaultHostName $rule.ActionHostName
60+
Assert-AreEqual $slotName $rule.Name
61+
}
62+
finally
63+
{
64+
# Cleanup
65+
Remove-AzResourceGroup -Name $rgname -Force
66+
}
67+
}
68+
69+
<#
70+
.SYNOPSIS
71+
Tests Removing the given Routing Rule.
72+
#>
73+
function Test-RemoveWebAppTrafficRoutingRule
74+
{
75+
# Setup
76+
$ReroutePercentage="15"
77+
$rgname = Get-ResourceGroupName
78+
$appname = Get-WebsiteName
79+
$location = Get-Location
80+
$slotName = "staging"
81+
$planName = Get-WebHostPlanName
82+
$tier = "Standard"
83+
$resourceType = "Microsoft.Web/sites"
84+
try
85+
{
86+
#Setup
87+
New-AzResourceGroup -Name $rgname -Location $location
88+
$serverFarm = New-AzAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier
89+
90+
# Create new web app
91+
$actual = New-AzWebApp -ResourceGroupName $rgname -Name $appname -Location $location -AppServicePlan $planName
92+
93+
# Assert
94+
Assert-AreEqual $appname $actual.Name
95+
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId
96+
97+
# Create deployment slot
98+
$job = New-AzWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotName -AsJob
99+
$job | Wait-Job
100+
$slot = $job | Receive-Job
101+
102+
$appWithSlotName = "$appname/$slotName"
103+
104+
# Assert
105+
Assert-AreEqual $appWithSlotName $slot.Name
106+
Assert-AreEqual $serverFarm.Id $slot.ServerFarmId
107+
108+
#Add Routing Rule for $slot
109+
$rule=Add-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RoutingRule @{ActionHostName=$slot.DefaultHostName;ReroutePercentage=$ReroutePercentage;Name=$slotName}
110+
111+
# Assert
112+
Assert-AreEqual $ReroutePercentage $rule.ReroutePercentage
113+
Assert-AreEqual $slot.DefaultHostName $rule.ActionHostName
114+
Assert-AreEqual $slotName $rule.Name
115+
116+
#remove
117+
$rule=Remove-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RuleName $rule.Name
118+
119+
#Assert
120+
Assert-Null -eq $rule
121+
}
122+
finally
123+
{
124+
# Cleanup
125+
Remove-AzResourceGroup -Name $rgname -Force
126+
}
127+
}
128+
129+
<#
130+
.SYNOPSIS
131+
Tests Returns the given Routing Rule.
132+
#>
133+
function Test-GetWebAppTrafficRoutingRule
134+
{
135+
# Setup
136+
$ReroutePercentage="15"
137+
$rgname = Get-ResourceGroupName
138+
$appname = Get-WebsiteName
139+
$location = Get-Location
140+
$slotName = "staging"
141+
$planName = Get-WebHostPlanName
142+
$tier = "Standard"
143+
$resourceType = "Microsoft.Web/sites"
144+
try
145+
{
146+
#Setup
147+
New-AzResourceGroup -Name $rgname -Location $location
148+
$serverFarm = New-AzAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier
149+
150+
# Create new web app
151+
$actual = New-AzWebApp -ResourceGroupName $rgname -Name $appname -Location $location -AppServicePlan $planName
152+
153+
# Assert
154+
Assert-AreEqual $appname $actual.Name
155+
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId
156+
157+
# Create deployment slot
158+
$job = New-AzWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotName -AsJob
159+
$job | Wait-Job
160+
$slot = $job | Receive-Job
161+
162+
$appWithSlotName = "$appname/$slotName"
163+
164+
# Assert
165+
Assert-AreEqual $appWithSlotName $slot.Name
166+
Assert-AreEqual $serverFarm.Id $slot.ServerFarmId
167+
168+
#Add Routing Rule for $slot
169+
Add-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RoutingRule @{ActionHostName=$slot.DefaultHostName;ReroutePercentage=$ReroutePercentage;Name=$slotName}
170+
#Get
171+
$rule= Get-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RuleName $slotName
172+
173+
# Assert
174+
Assert-AreEqual $ReroutePercentage $rule.ReroutePercentage
175+
Assert-AreEqual $slot.DefaultHostName $rule.ActionHostName
176+
Assert-AreEqual $slotName $rule.Name
177+
}
178+
finally
179+
{
180+
# Cleanup
181+
Remove-AzResourceGroup -Name $rgname -Force
182+
}
183+
}
184+
185+
<#
186+
.SYNOPSIS
187+
Tests Updates the given Routing Rule.
188+
#>
189+
function Test-UpdateWebAppTrafficRoutingRule
190+
{
191+
# Setup
192+
$ReroutePercentage="15"
193+
$updatedReroutePercentage="20"
194+
$rgname = Get-ResourceGroupName
195+
$appname = Get-WebsiteName
196+
$location = Get-Location
197+
$slotName = "staging"
198+
$planName = Get-WebHostPlanName
199+
$tier = "Standard"
200+
$resourceType = "Microsoft.Web/sites"
201+
try
202+
{
203+
#Setup
204+
New-AzResourceGroup -Name $rgname -Location $location
205+
$serverFarm = New-AzAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier
206+
207+
# Create new web app
208+
$actual = New-AzWebApp -ResourceGroupName $rgname -Name $appname -Location $location -AppServicePlan $planName
209+
210+
# Assert
211+
Assert-AreEqual $appname $actual.Name
212+
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId
213+
214+
# Create deployment slot
215+
$job = New-AzWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotName -AsJob
216+
$job | Wait-Job
217+
$slot = $job | Receive-Job
218+
219+
$appWithSlotName = "$appname/$slotName"
220+
221+
# Assert
222+
Assert-AreEqual $appWithSlotName $slot.Name
223+
Assert-AreEqual $serverFarm.Id $slot.ServerFarmId
224+
225+
#Add Routing Rule for $slot
226+
$rule=Add-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RoutingRule @{ActionHostName=$slot.DefaultHostName;ReroutePercentage=$ReroutePercentage;Name=$slotName}
227+
228+
# Assert
229+
Assert-AreEqual $ReroutePercentage $rule.ReroutePercentage
230+
Assert-AreEqual $slot.DefaultHostName $rule.ActionHostName
231+
Assert-AreEqual $slotName $rule.Name
232+
233+
#Update Routing Rule for $slot
234+
$rule=Update-AzWebAppTrafficRouting -ResourceGroupName $rgname -WebAppName $appname -RoutingRule @{ActionHostName=$slot.DefaultHostName;ReroutePercentage=$updatedReroutePercentage;Name=$slotName}
235+
236+
# Assert
237+
Assert-AreEqual $updatedReroutePercentage $rule.ReroutePercentage
238+
Assert-AreEqual $slot.DefaultHostName $rule.ActionHostName
239+
Assert-AreEqual $slotName $rule.Name
240+
}
241+
finally
242+
{
243+
# Cleanup
244+
Remove-AzResourceGroup -Name $rgname -Force
245+
}
246+
}

0 commit comments

Comments
 (0)