Skip to content

Commit

Permalink
AppService - fix bug in flattening ip_restriction shared code (#16426)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops authored Apr 20, 2022
1 parent 5ef9d7b commit 4bbc17e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/services/appservice/helpers/shared_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ func FlattenIpRestrictions(ipRestrictionsList *[]web.IPSecurityRestriction) []Ip
if *v.IPAddress == "Any" {
continue
}
ipRestriction.IpAddress = *v.IPAddress

if v.Tag == web.IPFilterTagServiceTag {
ipRestriction.ServiceTag = *v.IPAddress
} else {
Expand Down
11 changes: 11 additions & 0 deletions internal/services/appservice/windows_function_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ func TestAccWindowsFunctionApp_appStackDotNet6(t *testing.T) {
data.ImportStep(),
})
}

func TestAccWindowsFunctionApp_appStackDotNet6Isolated(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test")
r := WindowsFunctionAppResource{}
Expand Down Expand Up @@ -918,6 +919,7 @@ func TestAccWindowsFunctionApp_storageAccountKeyVaultSecret(t *testing.T) {
data.ImportStep(),
})
}

func TestAccWindowsFunctionApp_storageAccountKeyVaultSecretVersionless(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test")
r := WindowsFunctionAppResource{}
Expand Down Expand Up @@ -1214,6 +1216,7 @@ resource "azurerm_windows_function_app" "test" {
]
http2_enabled = true
ip_restriction {
ip_address = "10.10.10.10/32"
name = "test-restriction"
Expand All @@ -1226,6 +1229,14 @@ resource "azurerm_windows_function_app" "test" {
x_forwarded_host = ["example.com"]
}
}
ip_restriction {
service_tag = "ActionGroup"
name = "test-servicetag-restriction"
priority = 125
action = "Allow"
}
load_balancing_mode = "LeastResponseTime"
remote_debugging_enabled = true
remote_debugging_version = "VS2019"
Expand Down

0 comments on commit 4bbc17e

Please sign in to comment.