Skip to content

bug fix and test case for slot issue #441

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

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function Test-CreatesNewSimpleWebApp
$whpName = Get-WebHostPlanName
$apiversion = "2014-04-01"
$resourceType = "Microsoft.Web/sites"
$slotName = $wname + "(Dev)"
try
{
#Setup
Expand All @@ -34,10 +35,13 @@ function Test-CreatesNewSimpleWebApp
# Test
$actual = New-AzureWebApp -ResourceGroupName $rgname -Name $wname -Location $location -AppServicePlan $whpName
$result = Get-AzureWebApp -ResourceGroupName $rgname -Name $wname
$slotCreate = New-AzureWebApp -ResourceGroupName $rgname -Name $wname -Location $location -AppServicePlan $whpName -SlotName Dev


# Assert
Assert-AreEqual $wname $result.Name
Assert-AreEqual $whpName $result.Properties.ServerFarm
Assert-AreEqual $slotName $slotCreate.Name
}
finally
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ public WebSiteManagementClient WrappedWebsitesClient

public WebSite CreateWebsite(string resourceGroupName, string webSiteName, string slotName, string location, string webHostingPlan)
{
string webSiteSlotName = webSiteName;
if (string.IsNullOrEmpty(slotName) == false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use !string.IsNullOrEmpty(slotName)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, I think its stylistic fix?

{
webSiteSlotName = string.Concat(webSiteName, "/", slotName);

}

var createdWebSite = WrappedWebsitesClient.WebSites.CreateOrUpdate(
resourceGroupName, webSiteName, slotName,
new WebSiteCreateOrUpdateParameters
{
WebSite = new WebSiteBase
{
Name = webSiteName,
Name = webSiteSlotName,
Location = location,
Properties = new WebSiteBaseProperties(webHostingPlan)
}
Expand Down