From daa1376a11cc1c2680d6ccbb98feb823e077940b Mon Sep 17 00:00:00 2001 From: vanwijk Date: Fri, 15 Apr 2022 11:55:25 +0200 Subject: [PATCH 1/2] fix slot name formatting --- .../services/appservice/linux_function_app_slot_resource.go | 2 +- .../services/appservice/windows_function_app_slot_resource.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/appservice/linux_function_app_slot_resource.go b/internal/services/appservice/linux_function_app_slot_resource.go index 3dd686a2de4a..5e996243c759 100644 --- a/internal/services/appservice/linux_function_app_slot_resource.go +++ b/internal/services/appservice/linux_function_app_slot_resource.go @@ -344,7 +344,7 @@ func (r LinuxFunctionAppSlotResource) Create() sdk.ResourceFunc { } availabilityRequest := web.ResourceNameAvailabilityRequest{ - Name: utils.String(functionAppSlot.Name), + Name: utils.String(fmt.Sprintf("%s-%s", functionAppId.SiteName, functionAppSlot.Name)), Type: web.CheckNameResourceTypesMicrosoftWebsites, } diff --git a/internal/services/appservice/windows_function_app_slot_resource.go b/internal/services/appservice/windows_function_app_slot_resource.go index 5900a8acc2c4..ab0ad2016b51 100644 --- a/internal/services/appservice/windows_function_app_slot_resource.go +++ b/internal/services/appservice/windows_function_app_slot_resource.go @@ -350,7 +350,7 @@ func (r WindowsFunctionAppSlotResource) Create() sdk.ResourceFunc { } availabilityRequest := web.ResourceNameAvailabilityRequest{ - Name: utils.String(functionAppSlot.Name), + Name: utils.String(fmt.Sprintf("%s-%s", functionAppId.SiteName, functionAppSlot.Name)), Type: web.CheckNameResourceTypesMicrosoftWebsites, } From 3ddb139df92f274d6269743073052f0c42734350 Mon Sep 17 00:00:00 2001 From: jackofallops <11830746+jackofallops@users.noreply.github.com> Date: Tue, 24 May 2022 11:29:24 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- .../services/appservice/linux_function_app_slot_resource.go | 2 +- .../services/appservice/windows_function_app_slot_resource.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/appservice/linux_function_app_slot_resource.go b/internal/services/appservice/linux_function_app_slot_resource.go index 5e996243c759..492d253b4ced 100644 --- a/internal/services/appservice/linux_function_app_slot_resource.go +++ b/internal/services/appservice/linux_function_app_slot_resource.go @@ -344,7 +344,7 @@ func (r LinuxFunctionAppSlotResource) Create() sdk.ResourceFunc { } availabilityRequest := web.ResourceNameAvailabilityRequest{ - Name: utils.String(fmt.Sprintf("%s-%s", functionAppId.SiteName, functionAppSlot.Name)), + Name: utils.String(fmt.Sprintf("%s-%s", id.SiteName, id.SlotName)), Type: web.CheckNameResourceTypesMicrosoftWebsites, } diff --git a/internal/services/appservice/windows_function_app_slot_resource.go b/internal/services/appservice/windows_function_app_slot_resource.go index ab0ad2016b51..ba5fe02e5a93 100644 --- a/internal/services/appservice/windows_function_app_slot_resource.go +++ b/internal/services/appservice/windows_function_app_slot_resource.go @@ -350,7 +350,7 @@ func (r WindowsFunctionAppSlotResource) Create() sdk.ResourceFunc { } availabilityRequest := web.ResourceNameAvailabilityRequest{ - Name: utils.String(fmt.Sprintf("%s-%s", functionAppId.SiteName, functionAppSlot.Name)), + Name: utils.String(fmt.Sprintf("%s-%s", id.SiteName, id.SlotName)), Type: web.CheckNameResourceTypesMicrosoftWebsites, }