Skip to content

Commit

Permalink
Rename the new added attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Junyi Yi committed Nov 8, 2018
1 parent b61ebad commit edc8c40
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
6 changes: 3 additions & 3 deletions azurerm/resource_arm_function_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func resourceArmFunctionApp() *schema.Resource {
Optional: true,
},

"built_in_logging_enabled": {
"enable_builtin_logging": {
Type: schema.TypeBool,
Optional: true,
Default: true,
Expand Down Expand Up @@ -459,7 +459,7 @@ func resourceArmFunctionAppRead(d *schema.ResourceData, meta interface{}) error
d.Set("version", appSettings["FUNCTIONS_EXTENSION_VERSION"])

dashboard, ok := appSettings["AzureWebJobsDashboard"]
d.Set("built_in_logging_enabled", ok && dashboard != "")
d.Set("enable_builtin_logging", ok && dashboard != "")

delete(appSettings, "AzureWebJobsDashboard")
delete(appSettings, "AzureWebJobsStorage")
Expand Down Expand Up @@ -537,7 +537,7 @@ func getBasicFunctionAppAppSettings(d *schema.ResourceData, appServiceTier strin
{Name: &functionVersionPropName, Value: &functionVersion},
}

if d.Get("built_in_logging_enabled").(bool) {
if d.Get("enable_builtin_logging").(bool) {
basicSettings = append(basicSettings, web.NameValuePair{
Name: &dashboardPropName,
Value: &storageConnection,
Expand Down
48 changes: 24 additions & 24 deletions azurerm/resource_arm_function_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func TestAccAzureRMFunctionApp_loggingDisabled(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMFunctionAppExists(resourceName),
testCheckAzureRMFunctionAppHasNoContentShare(resourceName),
resource.TestCheckResourceAttr(resourceName, "built_in_logging_enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "enable_builtin_logging", "false"),
),
},
{
Expand Down Expand Up @@ -501,21 +501,21 @@ func TestAccAzureRMFunctionApp_updateLogging(t *testing.T) {
Config: enabledConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "built_in_logging_enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_builtin_logging", "true"),
),
},
{
Config: disabledConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMFunctionAppExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "built_in_logging_enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "enable_builtin_logging", "false"),
),
},
{
Config: enabledConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "built_in_logging_enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_builtin_logging", "true"),
),
},
},
Expand Down Expand Up @@ -1197,34 +1197,34 @@ resource "azurerm_function_app" "test" {
func testAccAzureRMFunctionApp_loggingDisabled(rInt int, storage string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]d"
location = "%[2]s"
name = "acctestRG-%[1]d"
location = "%[2]s"
}
resource "azurerm_storage_account" "test" {
name = "acctestsa%[3]s"
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
account_tier = "Standard"
account_replication_type = "LRS"
name = "acctestsa%[3]s"
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_app_service_plan" "test" {
name = "acctestASP-%[1]d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
tier = "Standard"
size = "S1"
}
name = "acctestASP-%[1]d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_function_app" "test" {
name = "acctest-%[1]d-func"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}"
built_in_logging_enabled = false
name = "acctest-%[1]d-func"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}"
enable_builtin_logging = false
}`, rInt, location, storage)
}
2 changes: 2 additions & 0 deletions website/docs/r/function_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ The following arguments are supported:

* `app_settings` - (Optional) A key-value pair of App Settings.

* `enable_builtin_logging` - (Optional) Should the built-in logging of this Function App be enabled? Defaults to `true`.

* `connection_string` - (Optional) An `connection_string` block as defined below.

* `client_affinity_enabled` - (Optional) Should the Function App send session affinity cookies, which route client requests in the same session to the same instance?
Expand Down

0 comments on commit edc8c40

Please sign in to comment.