diff --git a/azurerm/resource_arm_app_service.go b/azurerm/resource_arm_app_service.go index 9b43e3fde6e1..c0cd4cc605b6 100644 --- a/azurerm/resource_arm_app_service.go +++ b/azurerm/resource_arm_app_service.go @@ -87,7 +87,6 @@ func resourceArmAppService() *schema.Resource { "connection_string": { Type: schema.TypeSet, Optional: true, - Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { diff --git a/azurerm/resource_arm_app_service_test.go b/azurerm/resource_arm_app_service_test.go index ec5f1b2cc29a..3b54cff17d05 100644 --- a/azurerm/resource_arm_app_service_test.go +++ b/azurerm/resource_arm_app_service_test.go @@ -672,6 +672,39 @@ func TestAccAzureRMAppService_clientAffinityUpdate(t *testing.T) { }) } +func TestAccAzureRMAppService_removeAllConnectionStrings(t *testing.T) { + resourceName := "azurerm_app_service.test" + ri := tf.AccRandTimeInt() + location := testLocation() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMAppServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAppService_connectionStrings(ri, location), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAppServiceExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "connection_string.#", "2"), + ), + }, + { + Config: testAccAzureRMAppService_basic(ri, location), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAppServiceExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "connection_string.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAzureRMAppService_connectionStrings(t *testing.T) { resourceName := "azurerm_app_service.test" ri := tf.AccRandTimeInt()