Skip to content

Adding AseName parameter to New-AzureRmWebApp and New-AzureRmWebAppSlot #1582

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 10 commits into from
Jan 7, 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
2 changes: 1 addition & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* New-AzureRmWebAppSSLBinding
* Get-AzureRmWebAppSSLBinding
* Remove-AzureRmWebAppSSLBinding
* Azure Websites: Added AseName and AseResourceGroupName parameters in New-AzureRmAppServicePlan cmdlet
* Azure Websites: Added AseName and AseResourceGroupName parameters in New-AzureRmWebApp and New-AzureRmAppServicePlan cmdlet

## 2015.12.14 version 1.0.2
* Azure Compute (ARM):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Websites, Version=1.0.0.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Websites.1.0.2-preview\lib\net45\Microsoft.Azure.Management.Websites.dll</HintPath>
<Private>True</Private>
</Reference>
Expand Down Expand Up @@ -129,6 +130,7 @@
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
<Private>True</Private>
Expand All @@ -139,13 +141,11 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="NewAzureWebsitesCommandTests.cs" />
<Compile Include="ScenarioTests\AppServicePlanTests.cs" />
<Compile Include="ScenarioTests\SSLBindingTests.cs" />
<Compile Include="ScenarioTests\WebAppSlotTests.cs" />
<Compile Include="ScenarioTests\WebsitesController.cs" />
<Compile Include="ScenarioTests\WebAppTests.cs" />
<Compile Include="WebsitesTestHelpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -210,6 +210,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCreateNewWebAppSlot.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestCreateNewWebAppSlotOnAse.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests\TestGetWebAppSlot.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -231,6 +234,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCloneNewWebAppWithNewTrafficManager.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewAppOnAse.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppTests\TestCreateNewWebApp.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ function Get-ResourceGroupName
return getAssetName
}

<#
.SYNOPSIS
Gets an aseName for testing.
#>
function Get-AseName
{
return getAssetName
}

<#
.SYNOPSIS
Gets the location for the Website. Default to West US if none found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public void TestCreateNewWebAppSlot()
WebsitesController.NewInstance.RunPsTest("Test-CreateNewWebAppSlot");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateNewWebAppSlotOnAse()
{
WebsitesController.NewInstance.RunPsTest("Test-CreateNewWebAppSlotOnAse");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetWebAppSlot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,65 @@ function Test-CreateNewWebAppSlot
}
}

<#
.SYNOPSIS
Tests creating a new web app slot on ASE.
#>
function Test-CreateNewWebAppSlotOnAse
{
# Setup
$rgname = "appdemorg"
$appname = Get-WebsiteName
$slotname = "staging"
$location = "West US"
$planName = "travel_production_plan"
$aseName = "asedemo"

$apiversion = "2015-08-01"
$resourceType = "Microsoft.Web/sites"
try
{
#Setup
$serverFarm = Get-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $planName

# Create new web app
$actual = New-AzureRmWebApp -ResourceGroupName $rgname -Name $appname -Location $location -AppServicePlan $planName -AseName $aseName

# Assert
Assert-AreEqual $appname $actual.Name
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId

# Get new web app
$result = Get-AzureRmWebApp -ResourceGroupName $rgname -Name $appname

# Assert
Assert-AreEqual $appname $result.Name
Assert-AreEqual $serverFarm.Id $result.ServerFarmId

# Create deployment slot
$slot1 = New-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotname -AppServicePlan $planName -AseName $aseName
$appWithSlotName = "$appname/$slotname"

# Assert
Assert-AreEqual $appWithSlotName $slot1.Name
Assert-AreEqual $serverFarm.Id $slot1.ServerFarmId

# Get new web app slot
$slot1 = Get-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotname

# Assert
Assert-AreEqual $appWithSlotName $slot1.Name
Assert-AreEqual $serverFarm.Id $slot1.ServerFarmId

}
finally
{
# Cleanup
Remove-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $slotname -Force
Remove-AzureRmWebApp -ResourceGroupName $rgname -Name $appname -Force
}
}

<#
.SYNOPSIS
Tests retrieving web app slots
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public void TestCreateNewWebApp()
WebsitesController.NewInstance.RunPsTest("Test-CreateNewWebApp");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateNewAppOnAse()
{
WebsitesController.NewInstance.RunPsTest("Test-CreateNewWebAppOnAse");
}

[Fact(Skip = "Needs investigation. Fails running playback")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetWebApp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,46 @@ function Test-CreateNewWebApp
}
}

<#
.SYNOPSIS
Tests creating a new website on an ase
#>
function Test-CreateNewWebAppOnAse
{
# Setup
$rgname = "appdemorg"
$wname = Get-WebsiteName
$location = "West US"
$whpName = "travel_production_plan"
$aseName = "asedemo"
$apiversion = "2015-08-01"
$resourceType = "Microsoft.Web/sites"
try
{
#Setup
$serverFarm = Get-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $whpName

# Create new web app
$actual = New-AzureRmWebApp -ResourceGroupName $rgname -Name $wname -Location $location -AppServicePlan $whpName -AseName $aseName

# Assert
Assert-AreEqual $wname $actual.Name
Assert-AreEqual $serverFarm.Id $actual.ServerFarmId

# Get new web app
$result = Get-AzureRmWebApp -ResourceGroupName $rgname -Name $wname

# Assert
Assert-AreEqual $wname $result.Name
Assert-AreEqual $serverFarm.Id $result.ServerFarmId
}
finally
{
# Cleanup
Remove-AzureRmWebApp -ResourceGroupName $rgname -Name $wname -Force
}
}

<#
.SYNOPSIS
Tests retrieving websites
Expand Down
Loading