Skip to content

Commit b8504f6

Browse files
committed
Commit#10980
1 parent 821b03f commit b8504f6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Websites/Websites/Cmdlets/DeploymentSlots/SetAzureWebAppSlot.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ public class SetAzureWebAppSlotCmdlet : WebAppSlotBaseCmdlet
133133
[ValidateSet("AllAllowed", "Disabled", "FtpsOnly")]
134134
public string FtpsState { get; set; }
135135

136+
[Parameter(ParameterSetName = ParameterSet1Name, Mandatory = false, HelpMessage = "Custom hostnames associated with web app")]
137+
[ValidateNotNullOrEmpty]
138+
public string[] HostNames { get; set; }
139+
136140

137141
public override void ExecuteCmdlet()
138142
{
@@ -260,6 +264,10 @@ public override void ExecuteCmdlet()
260264
//Update WebApp object after site update
261265
WebApp = new PSSite(WebsitesClient.GetWebApp(ResourceGroupName, Name, null));
262266
}
267+
if (parameters.Contains("HostNames"))
268+
{
269+
WebsitesClient.AddCustomHostNames(ResourceGroupName, location, Name, HostNames);
270+
}
263271

264272
break;
265273
case ParameterSet2Name:

src/Websites/Websites/Utilities/WebsitesClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public void AddCustomHostNames(string resourceGroupName, string location, string
150150
catch (Exception e)
151151
{
152152
WriteWarning("Could not set custom hostname '{0}'. Details: {1}", hostName, e.ToString());
153+
return;
153154
}
154155
}
155156

0 commit comments

Comments
 (0)