diff --git a/internal/services/appservice/linux_function_app_resource.go b/internal/services/appservice/linux_function_app_resource.go index 198aa172fd07..0403d7a2c6cf 100644 --- a/internal/services/appservice/linux_function_app_resource.go +++ b/internal/services/appservice/linux_function_app_resource.go @@ -578,6 +578,8 @@ func (r LinuxFunctionAppResource) Create() sdk.ResourceFunc { return fmt.Errorf("creating Linux %s: %+v", id, err) } + metadata.SetID(id) + stickySettings := helpers.ExpandStickySettings(functionApp.StickySettings) if stickySettings != nil { @@ -642,7 +644,6 @@ func (r LinuxFunctionAppResource) Create() sdk.ResourceFunc { } } - metadata.SetID(id) return nil }, } diff --git a/internal/services/appservice/linux_function_app_slot_resource.go b/internal/services/appservice/linux_function_app_slot_resource.go index daee586fe98f..ce8366142a5f 100644 --- a/internal/services/appservice/linux_function_app_slot_resource.go +++ b/internal/services/appservice/linux_function_app_slot_resource.go @@ -545,6 +545,8 @@ func (r LinuxFunctionAppSlotResource) Create() sdk.ResourceFunc { return fmt.Errorf("creating Linux %s: %+v", id, err) } + metadata.SetID(id) + if !functionAppSlot.PublishingDeployBasicAuthEnabled { sitePolicy := webapps.CsmPublishingCredentialsPoliciesEntity{ Properties: &webapps.CsmPublishingCredentialsPoliciesEntityProperties{ @@ -619,7 +621,6 @@ func (r LinuxFunctionAppSlotResource) Create() sdk.ResourceFunc { } } - metadata.SetID(id) return nil }, } diff --git a/internal/services/appservice/windows_function_app_resource.go b/internal/services/appservice/windows_function_app_resource.go index ab19055008ed..384b5b106a89 100644 --- a/internal/services/appservice/windows_function_app_resource.go +++ b/internal/services/appservice/windows_function_app_resource.go @@ -578,6 +578,8 @@ func (r WindowsFunctionAppResource) Create() sdk.ResourceFunc { return fmt.Errorf("updating properties of Windows %s: %+v", id, err) } + metadata.SetID(id) + stickySettings := helpers.ExpandStickySettings(functionApp.StickySettings) if stickySettings != nil { @@ -642,7 +644,6 @@ func (r WindowsFunctionAppResource) Create() sdk.ResourceFunc { } } - metadata.SetID(id) return nil }, } diff --git a/internal/services/appservice/windows_function_app_slot_resource.go b/internal/services/appservice/windows_function_app_slot_resource.go index f311c27c6816..1d1e85ad2672 100644 --- a/internal/services/appservice/windows_function_app_slot_resource.go +++ b/internal/services/appservice/windows_function_app_slot_resource.go @@ -588,6 +588,8 @@ func (r WindowsFunctionAppSlotResource) Create() sdk.ResourceFunc { return fmt.Errorf("updating properties of Windows %s: %+v", id, err) } + metadata.SetID(id) + backupConfig, err := helpers.ExpandBackupConfig(functionAppSlot.Backup) if err != nil { return fmt.Errorf("expanding backup configuration for Windows %s: %+v", id, err) @@ -636,7 +638,6 @@ func (r WindowsFunctionAppSlotResource) Create() sdk.ResourceFunc { } } - metadata.SetID(id) return nil }, }