Skip to content

Commit 47b26ee

Browse files
author
Maddie Clayton
authored
Merge pull request #6046 from markcowl/fix-web-net
Merge websites-preview branch for BUILD
2 parents c4a0b38 + acd5331 commit 47b26ee

File tree

126 files changed

+48407
-48869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+48407
-48869
lines changed

src/ResourceManager/Websites/AzureRM.Websites.psd1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ PrivateData = @{
129129
# IconUri = ''
130130

131131
# ReleaseNotes of this module
132-
ReleaseNotes = '* Updated to the latest version of the Azure ClientRuntime'
132+
ReleaseNotes = '* Upgrade to latest version of the Websites SDK
133+
* Added -AssignIdentity & -Httpsonly properties for SetAzureWebApp'
133134

134135
# Prerelease string of this module
135136
# Prerelease = ''
@@ -140,6 +141,8 @@ PrivateData = @{
140141
# External dependent modules of this module
141142
# ExternalModuleDependencies = @()
142143

144+
# Prerelease = ''
145+
143146
} # End of PSData hashtable
144147

145148
} # End of PrivateData hashtable

src/ResourceManager/Websites/ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Current Release
2121
* Set minimum dependency of module to PowerShell 5.0
22+
* Upgrade to latest version of the Websites SDK
23+
* Added -AssignIdentity & -Httpsonly properties for SetAzureWebApp
2224

2325
## Version 4.2.2
2426
* Updated to the latest version of the Azure ClientRuntime
@@ -32,6 +34,10 @@
3234
* Fixed issue with importing aliases
3335
* New-AzureRMWebApp - added parameter set for simplified WebApp creation, with local git repository support.
3436

37+
## Version 5.0.0-preview
38+
* Upgrade to latest version of the Websites SDK
39+
* Added -AssignIdentity & -Httpsonly properties for SetAzureWebApp
40+
3541
## Version 4.1.0
3642
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
3743
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription

src/ResourceManager/Websites/Commands.Websites.Test/Commands.Websites.Test.csproj

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@
5959
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.3.0.0\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
6060
<Private>True</Private>
6161
</Reference>
62-
<Reference Include="Microsoft.Azure.Management.Websites, Version=1.0.0.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Websites.1.2.0-preview\lib\net45\Microsoft.Azure.Management.Websites.dll</HintPath>
64-
<Private>True</Private>
62+
<Reference Include="Microsoft.Azure.Management.Websites, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Websites.1.7.1-preview\lib\net452\Microsoft.Azure.Management.Websites.dll</HintPath>
6564
</Reference>
6665
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6766
<SpecificVersion>False</SpecificVersion>
@@ -215,22 +214,22 @@
215214
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppBackupRestoreTests\TestGetWebAppBackupList.json">
216215
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
217216
</None>
218-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCloneWebAppSlot.json">
217+
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppBackupRestoreTests\TestGetWebAppSnapshots.json">
219218
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
220219
</None>
221-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCloneWebAppToSlot.json">
220+
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppBackupRestoreTests\TestRestoreWebAppSnapshot.json">
222221
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
223222
</None>
224-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCreateNewWebAppSlot.json">
223+
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCloneWebAppSlot.json">
225224
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
226225
</None>
227-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCreateNewWebAppSlotOnAse.json">
226+
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCloneWebAppToSlot.json">
228227
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
229228
</None>
230-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestGetWebAppSlot.json">
229+
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCreateNewWebAppSlot.json">
231230
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
232231
</None>
233-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestGetWebAppSlotMetrics.json">
232+
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestGetWebAppSlot.json">
234233
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
235234
</None>
236235
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestManageSlotSlotConfigName.json">
@@ -242,39 +241,18 @@
242241
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestStartStopRestartWebAppSlot.json">
243242
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
244243
</None>
245-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestWebAppRegularSlotSwap.json">
246-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
247-
</None>
248244
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestWebAppSlotPublishingProfile.json">
249245
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
250246
</None>
251-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestWebAppSwapWithPreviewCompleteSlotSwap.json">
252-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
253-
</None>
254-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestWebAppSwapWithPreviewResetSlotSwap.json">
255-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
256-
</None>
257247
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCloneNewWebApp.json">
258248
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
259249
</None>
260-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCloneNewWebAppAndDeploymentSlots.json">
261-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
262-
</None>
263-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCloneNewWebAppWithNewTrafficManager.json">
264-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
265-
</None>
266250
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewAppOnAse.json">
267251
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
268252
</None>
269253
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewWebApp.json">
270254
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
271255
</None>
272-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestGetWebApp.json">
273-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
274-
</None>
275-
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestGetWebAppMetrics.json">
276-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
277-
</None>
278256
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestRemoveWebApp.json">
279257
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
280258
</None>
@@ -322,7 +300,7 @@
322300
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
323301
</ItemGroup>
324302
<ItemGroup />
325-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
326303
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
327304
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
305+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
328306
</Project>

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/AppServicePlanTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void TestGetAppServicePlanMetrics()
6363
WebsitesController.NewInstance.RunPsTest("Test-GetAppServicePlanMetrics");
6464
}
6565

66-
[Fact]
66+
[Fact(Skip = "TODO #5594: This test requires a pre-set AppService Environment with specific settings.")]
6767
[Trait(Category.AcceptanceType, Category.CheckIn)]
6868
public void TestCreateNewAppServicePlanInAse()
6969
{

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/AppServicePlanTests.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -333,31 +333,29 @@ function Test-CreateNewAppServicePlanInAse
333333
$whpName = Get-WebHostPlanName
334334
$location = "West US"
335335
$capacity = 1
336-
$skuName = "S2"
337-
$aseName = "asedemo"
338-
$aseResourceGroupName = "appdemorg"
336+
$skuName = "I1"
337+
$skuTier = "Isolated"
338+
$aseName = "asedemops"
339+
$aseResourceGroupName = "asedemorg"
339340

340341
try
341342
{
342343
#Setup
343344
New-AzureRmResourceGroup -Name $rgname -Location $location
344345

345346
# Test
346-
$createResult = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName -Location $location -Tier "Standard" -WorkerSize Medium -NumberOfWorkers $capacity -AseName $aseName -AseResourceGroupName $aseResourceGroupName
347+
$createResult = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName -Location $location -Tier $skuTier -WorkerSize Medium -NumberOfWorkers $capacity -AseName $aseName -AseResourceGroupName $aseResourceGroupName
347348

348349
# Assert
349350
Assert-AreEqual $whpName $createResult.Name
350-
Assert-AreEqual "Standard" $createResult.Sku.Tier
351+
Assert-AreEqual "Isolated" $createResult.Sku.Tier
351352
Assert-AreEqual $skuName $createResult.Sku.Name
352-
Assert-AreEqual $capacity $createResult.Sku.Capacity
353353

354354
# Assert
355-
356355
$getResult = Get-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName
357356
Assert-AreEqual $whpName $getResult.Name
358-
Assert-AreEqual "Standard" $getResult.Sku.Tier
357+
Assert-AreEqual "Isolated" $getResult.Sku.Tier
359358
Assert-AreEqual $skuName $getResult.Sku.Name
360-
Assert-AreEqual $capacity $getResult.Sku.Capacity
361359
}
362360
finally
363361
{

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/Common.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ function Get-SecondaryLocation
123123

124124
if ($location -eq $null)
125125
{
126-
return "East US"
126+
return "West US"
127127
} else
128128
{
129129
return $location.Locations[1]
130130
}
131131
}
132132

133-
return "EastUS"
133+
return "WestUS"
134134
}
135135

136136
<#

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/SSLBindingTests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ assign a custom domain to it and update global variable values.
1717
#>
1818

1919
#Global variables
20-
$rgname = "webappsslbindingrb"
21-
$appname = "webappsslbindingtest"
20+
$rgname = "lketmtestantps10"
21+
$appname = "lketmtestantps10"
2222
$slot = "testslot"
23-
$prodHostname = "www.webappsslbindingtests.com"
24-
$slotHostname = "testslot.webappsslbindingtests.com"
25-
$thumbprint = "40D6600B0B8740C41BA4B3D13B967DDEF6ED1918"
23+
$prodHostname = "www.adorenow.net"
24+
$slotHostname = "testslot.adorenow.net"
25+
$thumbprint = "ECC61863C674D5CEE90AB06373D37342368F0413"
2626

2727
<#
2828
.SYNOPSIS
@@ -62,7 +62,7 @@ function Test-GetNewWebAppSSLBinding
6262

6363
# Test - Get commands for web app
6464
$getResult = Get-AzureRMWebAppSSLBinding -ResourceGroupName $rgname -WebAppName $appname
65-
Assert-AreEqual 2 $getResult.Count
65+
Assert-AreEqual 1 $getResult.Count
6666
$currentHostNames = $getResult | Select -expand Name
6767
Assert-True { $currentHostNames -contains $createWebAppResult.Name }
6868
$getResult = Get-AzureRMWebAppSSLBinding -ResourceGroupName $rgname -WebAppName $appname -Name $prodHostname
@@ -138,7 +138,7 @@ function Test-WebAppSSLBindingPipeSupport
138138

139139
# Test - Retrieve Ssl bindings using web app and web app slot objects
140140
$getResult = $webapp | Get-AzureRMWebAppSSLBinding
141-
Assert-AreEqual 2 $getResult.Count
141+
Assert-AreEqual 1 $getResult.Count
142142

143143
$getResult = $webappslot | Get-AzureRMWebAppSSLBinding
144144
Assert-AreEqual 1 $getResult.Count

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppBackupRestoreTests.ps1

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15+
# Snapshots require a Premium app to exist for several hours.
16+
# Deploy a Premium app and update these global variables to re-record the snapshots tests.
17+
$snapshotRgName = 'onesdksnapshots'
18+
$snapshotAppName = 'onesdkpremapp'
19+
$snapshotAppSlot = 'staging'
20+
1521
function Test-CreateNewWebAppBackup
1622
{
1723
$rgName = Get-ResourceGroupName
@@ -322,6 +328,56 @@ function Test-EditAndGetWebAppBackupConfigurationPiping
322328
}
323329
}
324330

331+
function Test-GetWebAppSnapshots
332+
{
333+
# Test named parameters
334+
$snapshots = Get-AzureRmWebAppSnapshot -ResourceGroupName $snapshotRgName -Name $snapshotAppName
335+
Assert-True { $snapshots.Length -gt 0 }
336+
Assert-NotNull $snapshots[0]
337+
Assert-NotNull $snapshots[0].SnapshotTime
338+
Assert-AreEqual 'Production' $snapshots[0].Slot
339+
340+
# Test positional parameters
341+
$snapshots = Get-AzureRmWebAppSnapshot $snapshotRgName $snapshotAppName
342+
Assert-True { $snapshots.Length -gt 0 }
343+
Assert-NotNull $snapshots[0]
344+
Assert-NotNull $snapshots[0].SnapshotTime
345+
Assert-AreEqual 'Production' $snapshots[0].Slot
346+
347+
# Test snapshots for slots
348+
$snapshots = Get-AzureRmWebAppSnapshot -ResourceGroupName $snapshotRgName -Name $snapshotAppName -Slot $snapshotAppSlot
349+
Assert-True { $snapshots.Length -gt 0 }
350+
Assert-NotNull $snapshots[0]
351+
Assert-NotNull $snapshots[0].SnapshotTime
352+
Assert-AreEqual $snapshotAppSlot $snapshots[0].Slot
353+
354+
# Test piping
355+
$app = Get-AzureRmWebApp -ResourceGroupName $snapshotRgName -Name $snapshotAppName
356+
$snapshots = $app | Get-AzureRmWebAppSnapshot
357+
Assert-True { $snapshots.Length -gt 0 }
358+
Assert-NotNull $snapshots[0]
359+
Assert-NotNull $snapshots[0].SnapshotTime
360+
Assert-AreEqual 'Production' $snapshots[0].Slot
361+
}
362+
363+
function Test-RestoreWebAppSnapshot
364+
{
365+
# Test overwrite
366+
$snapshot = (Get-AzureRmWebAppSnapshot $snapshotRgName $snapshotAppName)[0]
367+
Restore-AzureRmWebAppSnapshot -ResourceGroupName $snapshotRgName -Name $snapshotAppName -SnapshotTime $snapshot.SnapshotTime -Force -RecoverConfiguration
368+
369+
# Test restore to target slot
370+
$target = Get-AzureRmWebAppSlot -ResourceGroupName $snapshotRgName -Name $snapshotAppName -Slot $snapshotAppSlot
371+
Restore-AzureRmWebAppSnapshot -ResourceGroupName $snapshotRgName -Name $snapshotAppName -SnapshotTime $snapshot.SnapshotTime -RecoverConfiguration -TargetApp $target
372+
373+
# Test piping
374+
$snapshot | Restore-AzureRmWebAppSnapshot -Force
375+
376+
# Test background job
377+
$snapshot | Restore-AzureRmWebAppSnapshot -Force -AsJob
378+
$job | Wait-Job
379+
}
380+
325381
# Utility functions
326382

327383
# Creates a new web app
@@ -354,7 +410,10 @@ function Create-TestStorageAccount
354410
$stoKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroup -Name $storageName).Key1;
355411
# 2 hour access duration
356412
$accessDuration = New-Object -TypeName TimeSpan(2,0,0)
357-
$permissions = [Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions]::Write
413+
$permissions = [Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions]::Write -bor
414+
[Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions]::Read -bor
415+
[Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions]::List -bor
416+
[Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions]::Delete
358417
$sasUri = Get-SasUri $storageName $stoKey $stoContainerName $accessDuration $permissions
359418
return $sasUri
360-
}
419+
}

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppSlotTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void TestWebAppRegularSlotSwap()
106106
WebsitesController.NewInstance.RunPsTest("Test-WebAppRegularSlotSwap");
107107
}
108108

109-
[Fact]
109+
[Fact(Skip = "iss#6044 The test needs to be re-written")]
110110
[Trait(Category.AcceptanceType, Category.CheckIn)]
111111
public void TestWebAppSwapWithPreviewResetSlotSwap()
112112
{

0 commit comments

Comments
 (0)