From 9b835c94cda981015917d9f2f9f92721a68d9de3 Mon Sep 17 00:00:00 2001 From: Erik <5303774+erjdev@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:55:07 -0400 Subject: [PATCH] Updated windows function app state upgrader to check validity of type assertion instead of fatal --- .../appservice/migration/windows_function_app_slot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/appservice/migration/windows_function_app_slot.go b/internal/services/appservice/migration/windows_function_app_slot.go index b73f321481ca..ba9c67fee85c 100644 --- a/internal/services/appservice/migration/windows_function_app_slot.go +++ b/internal/services/appservice/migration/windows_function_app_slot.go @@ -1527,9 +1527,9 @@ func (w WindowsFunctionAppSlotV0toV1) Schema() map[string]*pluginsdk.Schema { func (w WindowsFunctionAppSlotV0toV1) 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)