From 28dde1921105640e5d682c8c0803d2834ca51a46 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 12 Jan 2024 11:34:55 +0100 Subject: [PATCH] r/application_gateway: conditionally handling `both` for `components` --- .../network/application_gateway_resource.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/internal/services/network/application_gateway_resource.go b/internal/services/network/application_gateway_resource.go index f2443a188c37..0003f0247c88 100644 --- a/internal/services/network/application_gateway_resource.go +++ b/internal/services/network/application_gateway_resource.go @@ -3848,6 +3848,7 @@ func flattenApplicationGatewayRewriteRuleSets(input *[]network.ApplicationGatewa if actionSet.URLConfiguration != nil { config := *actionSet.URLConfiguration components := "" + path := "" if config.ModifiedPath != nil { path = *config.ModifiedPath @@ -3858,12 +3859,17 @@ func flattenApplicationGatewayRewriteRuleSets(input *[]network.ApplicationGatewa queryString = *config.ModifiedQueryString } - if path != queryString { - if path != "" && queryString == "" { - components = "path_only" - } else if queryString != "" && path == "" { - components = "query_string_only" - } + // `components` doesn't exist in the API - it appears to be purely a UI state in the Portal + // as such we should consider removing this field in the future. + if path == queryString { + // used to represent `both` + components = "" + } + if config.ModifiedQueryString != nil && config.ModifiedPath == nil { + components = "query_string_only" + } + if config.ModifiedQueryString == nil && config.ModifiedPath != nil { + components = "path_only" } reroute := false