Skip to content

Commit

Permalink
r/app_service: making auth_settings computed/the linux tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed May 22, 2019
1 parent b2e0bbc commit 5a9e7fc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
5 changes: 3 additions & 2 deletions azurerm/helpers/azure/app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func SchemaAppServiceAuthSettings() *schema.Schema {
return &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -860,12 +861,12 @@ func FlattenAdditionalLoginParams(input *[]string) map[string]interface{} {

func FlattenAppServiceAuthSettings(input *web.SiteAuthSettingsProperties) []interface{} {
results := make([]interface{}, 0)
result := make(map[string]interface{})

if input == nil {
return results
}

result := make(map[string]interface{})

if input.Enabled != nil {
result["enabled"] = *input.Enabled
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func resourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error {

authSettings := azure.FlattenAppServiceAuthSettings(authResp.SiteAuthSettingsProperties)
if err := d.Set("auth_settings", authSettings); err != nil {
return fmt.Errorf("Error setting `auth_settings`: %+s", err)
return fmt.Errorf("Error setting `auth_settings`: %s", err)
}

scm := flattenAppServiceSourceControl(scmResp.SiteSourceControlProperties)
Expand Down
27 changes: 25 additions & 2 deletions azurerm/resource_arm_app_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3067,12 +3067,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand All @@ -3088,8 +3090,8 @@ resource "azurerm_app_service" "test" {
issuer = "https://sts.windows.net/%s"
additional_login_params = {
test_key = "test_value"
}
test_key = "test_value"
}
active_directory {
client_id = "aadclientid"
Expand All @@ -3116,12 +3118,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3165,12 +3169,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3211,12 +3217,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3257,12 +3265,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3303,12 +3313,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3349,12 +3361,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3393,12 +3407,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3436,12 +3452,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3479,6 +3497,7 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
Expand Down Expand Up @@ -3522,12 +3541,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down Expand Up @@ -3561,12 +3582,14 @@ resource "azurerm_app_service_plan" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
name = "acctestRG-%d"
kind = "Linux"
reserved = true
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "test" {
name = "acctestRG-%d"
location = "${azurerm_resource_group.test.location}"
Expand Down

0 comments on commit 5a9e7fc

Please sign in to comment.