From 4d2913fc3d94b8b315fb07d1f92fba178e708279 Mon Sep 17 00:00:00 2001 From: Steve Officer Date: Tue, 30 Apr 2019 18:57:23 +0100 Subject: [PATCH] Binding HostName to Deployment slot uses name incorrectly. (#250) * Fixed an issue with the incorrect deployment slot name being used when binding hostnames. * Update LICENSE.txt --- LICENSE.txt | 1 + src/ResourceManagement/AppService/HostNameBindingImpl.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 3423e9584d1..b8b569d7746 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/src/ResourceManagement/AppService/HostNameBindingImpl.cs b/src/ResourceManagement/AppService/HostNameBindingImpl.cs index dd72974c0b3..57f2f037f33 100644 --- a/src/ResourceManagement/AppService/HostNameBindingImpl.cs +++ b/src/ResourceManagement/AppService/HostNameBindingImpl.cs @@ -103,8 +103,8 @@ public HostNameBindingImpl CreateAsync(CancellationToken cancellationToken = default(CancellationToken)) { - var hostNameBindingInner = parent is IDeploymentSlot - ? await parent.Manager.Inner.WebApps.CreateOrUpdateHostNameBindingSlotAsync(parent.ResourceGroupName, ((IDeploymentSlot)parent).Parent.Name, name, Inner, parent.Name) + var hostNameBindingInner = parent is IDeploymentSlot deploymentSlot + ? await parent.Manager.Inner.WebApps.CreateOrUpdateHostNameBindingSlotAsync(parent.ResourceGroupName, deploymentSlot.Parent.Name, name, Inner, deploymentSlot.Name) : await parent.Manager.Inner.WebApps.CreateOrUpdateHostNameBindingAsync(parent.ResourceGroupName, parent.Name, name, Inner); SetInner(hostNameBindingInner);