From 93f1adee773772fd5700b5fc1d7da31bc9007fbc Mon Sep 17 00:00:00 2001 From: christian-calabrese Date: Fri, 17 May 2024 23:49:18 +0200 Subject: [PATCH] `azurerm_linux_function_app_slot` - fixed panic when planning from a version older than 3.88.0 (#25838) --- .../services/appservice/migration/linux_function_app_slot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/appservice/migration/linux_function_app_slot.go b/internal/services/appservice/migration/linux_function_app_slot.go index d26019e371a5..a7c6107e9d93 100644 --- a/internal/services/appservice/migration/linux_function_app_slot.go +++ b/internal/services/appservice/migration/linux_function_app_slot.go @@ -1575,9 +1575,9 @@ func (l LinuxFunctionAppSlotV0toV1) Schema() map[string]*pluginsdk.Schema { func (l LinuxFunctionAppSlotV0toV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { - oldId := rawState["service_plan_id"].(string) + oldId, ok := rawState["service_plan_id"].(string) // service_plan_id can be empty if it is not in a different Service Plan to the "parent" app - if oldId == "" { + if !ok || oldId == "" { return rawState, nil } parsedId, err := commonids.ParseAppServicePlanIDInsensitively(oldId)