diff --git a/azurerm/internal/services/analysisservices/tests/resource_arm_analysis_services_server_test.go b/azurerm/internal/services/analysisservices/tests/resource_arm_analysis_services_server_test.go index 4e315297bb4c..512db8070273 100644 --- a/azurerm/internal/services/analysisservices/tests/resource_arm_analysis_services_server_test.go +++ b/azurerm/internal/services/analysisservices/tests/resource_arm_analysis_services_server_test.go @@ -27,11 +27,7 @@ func TestAccAzureRMAnalysisServicesServer_basic(t *testing.T) { testCheckAzureRMAnalysisServicesServerExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -170,19 +166,11 @@ func TestAccAzureRMAnalysisServicesServer_adminUsers(t *testing.T) { { Config: preConfig, }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), { Config: postConfig, }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -202,11 +190,7 @@ func TestAccAzureRMAnalysisServicesServer_serverFullName(t *testing.T) { resource.TestCheckResourceAttrSet(data.ResourceName, "server_full_name"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_test.go index ae44c431f0d8..34a3db939949 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMApiManagementApiOperation_basic(t *testing.T) { testCheckAzureRMApiManagementApiOperationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -73,11 +69,7 @@ func TestAccAzureRMApiManagementApiOperation_customMethod(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "method", "HAMMERTIME"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -96,11 +88,7 @@ func TestAccAzureRMApiManagementApiOperation_headers(t *testing.T) { testCheckAzureRMApiManagementApiOperationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -119,22 +107,14 @@ func TestAccAzureRMApiManagementApiOperation_requestRepresentations(t *testing.T testCheckAzureRMApiManagementApiOperationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), { Config: testAccAzureRMApiManagementApiOperation_requestRepresentationUpdated(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMApiManagementApiOperationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -154,22 +134,14 @@ func TestAccAzureRMApiManagementApiOperation_representations(t *testing.T) { testCheckAzureRMApiManagementApiOperationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), { Config: testAccAzureRMApiManagementApiOperation_representationUpdated(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMApiManagementApiOperationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_schema_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_schema_test.go index 45b30785bd3e..44e2d6f01a41 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_schema_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_schema_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMApiManagementApiSchema_basic(t *testing.T) { testCheckAzureRMApiManagementApiSchemaExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_test.go index 3f524561b005..1aa95caf9c72 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_test.go @@ -29,11 +29,7 @@ func TestAccAzureRMApiManagementApi_basic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "is_online", "false"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -56,11 +52,7 @@ func TestAccAzureRMApiManagementApi_basicClassic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "is_online", "false"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -80,11 +72,7 @@ func TestAccAzureRMApiManagementApi_wordRevision(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "revision", "one-point-oh"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -104,11 +92,7 @@ func TestAccAzureRMApiManagementApi_version(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "version", "v1"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -150,11 +134,7 @@ func TestAccAzureRMApiManagementApi_soapPassthrough(t *testing.T) { testCheckAzureRMApiManagementApiExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -269,11 +249,7 @@ func TestAccAzureRMApiManagementApi_complete(t *testing.T) { testCheckAzureRMApiManagementApiExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -548,7 +524,7 @@ resource "azurerm_api_management" "test" { func testAccAzureRMApiManagementApi_templateClassic(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_version_set_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_version_set_test.go index 3f434ea59eb2..7f507e129e85 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_version_set_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_version_set_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMApiManagementApiVersionSet_basic(t *testing.T) { testCheckAzureRMApiManagementApiVersionSetExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -72,11 +68,7 @@ func TestAccAzureRMApiManagementApiVersionSet_header(t *testing.T) { testCheckAzureRMApiManagementApiVersionSetExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -95,11 +87,7 @@ func TestAccAzureRMApiManagementApiVersionSet_query(t *testing.T) { testCheckAzureRMApiManagementApiVersionSetExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -128,11 +116,7 @@ func TestAccAzureRMApiManagementApiVersionSet_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestApiVersionSet2%d", data.RandomInteger)), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go index 45a444c02cfe..e5e1f452c009 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMAPIManagementAuthorizationServer_basic(t *testing.T) { testCheckAzureRMAPIManagementAuthorizationServerExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -72,11 +68,7 @@ func TestAccAzureRMAPIManagementAuthorizationServer_complete(t *testing.T) { testCheckAzureRMAPIManagementAuthorizationServerExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_backend_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_backend_test.go index aa3ccb482946..01a4f454847f 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_backend_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_backend_test.go @@ -28,11 +28,7 @@ func TestAccAzureRMApiManagementBackend_basic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "url", "https://acctest"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -71,11 +67,7 @@ func TestAccAzureRMApiManagementBackend_allProperties(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "tls.0.validate_certificate_name", "true"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -94,11 +86,7 @@ func TestAccAzureRMApiManagementBackend_credentialsNoCertificate(t *testing.T) { testCheckAzureRMApiManagementBackendExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -173,11 +161,7 @@ func TestAccAzureRMApiManagementBackend_serviceFabric(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "service_fabric_cluster.0.server_certificate_thumbprints.#", "2"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_diagnostic_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_diagnostic_test.go index f219e1f6204b..a70d65aa3270 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_diagnostic_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_diagnostic_test.go @@ -27,11 +27,7 @@ func TestAccAzureRMApiManagementDiagnostic_basic(t *testing.T) { testCheckAzureRMApiManagementDiagnosticExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_test.go index 93a9da21050e..3fb9f6be3e8b 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_test.go @@ -29,11 +29,7 @@ func TestAccAzureRMAPIManagementGroup_basic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "type", "custom"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -82,11 +78,7 @@ func TestAccAzureRMAPIManagementGroup_complete(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "type", "external"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_user_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_user_test.go index f620c37e57da..f38cc9e4e68e 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_user_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_user_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMAPIManagementGroupUser_basic(t *testing.T) { testCheckAzureRMAPIManagementGroupUserExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_openid_connect_provider_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_openid_connect_provider_test.go index 06920a5e3b30..306e4a839aab 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_openid_connect_provider_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_openid_connect_provider_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMApiManagementOpenIDConnectProvider_basic(t *testing.T) { testCheckAzureRMApiManagementOpenIDConnectProviderExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -78,11 +74,7 @@ func TestAccAzureRMApiManagementOpenIDConnectProvider_update(t *testing.T) { testCheckAzureRMApiManagementOpenIDConnectProviderExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_api_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_api_test.go index 1b861f128a11..6d9f027355d8 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_api_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_api_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMAPIManagementProductApi_basic(t *testing.T) { testCheckAzureRMAPIManagementProductApiExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_group_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_group_test.go index 400ef7ad8e0b..e6b1c5a5f806 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_group_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_group_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMAPIManagementProductGroup_basic(t *testing.T) { testCheckAzureRMAPIManagementProductGroupExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_test.go index 2b630eccb52f..acb42c5c182f 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_test.go @@ -34,11 +34,7 @@ func TestAccAzureRMApiManagementProduct_basic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "terms", ""), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -114,11 +110,7 @@ func TestAccAzureRMApiManagementProduct_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "terms", ""), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), { Config: testAccAzureRMApiManagementProduct_updated(data), Check: resource.ComposeTestCheckFunc( @@ -132,11 +124,7 @@ func TestAccAzureRMApiManagementProduct_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "terms", ""), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), { Config: testAccAzureRMApiManagementProduct_basic(data), Check: resource.ComposeTestCheckFunc( @@ -170,11 +158,7 @@ func TestAccAzureRMApiManagementProduct_subscriptionsLimit(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "subscriptions_limit", "2"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -201,11 +185,7 @@ func TestAccAzureRMApiManagementProduct_complete(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "terms", "These are some example terms and conditions"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go index bb330151d7d7..9fd43131abfc 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go @@ -30,11 +30,7 @@ func TestAccAzureRMAPIManagementProperty_basic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -70,11 +66,7 @@ func TestAccAzureRMAPIManagementProperty_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag4"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go index 1bbd2a2f9255..b8190f3625ae 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go @@ -29,11 +29,7 @@ func TestAccAzureRMAPIManagementSubscription_basic(t *testing.T) { resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -125,11 +121,7 @@ func TestAccAzureRMAPIManagementSubscription_complete(t *testing.T) { resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_test.go index e24401e12e3e..b4dd75350b13 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_test.go @@ -28,11 +28,7 @@ func TestAccAzureRMApiManagement_basic(t *testing.T) { testCheckAzureRMApiManagementExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -53,11 +49,7 @@ func TestAccAzureRMApiManagement_basicClassic(t *testing.T) { testCheckAzureRMApiManagementExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -119,11 +111,7 @@ func TestAccAzureRMApiManagement_customProps(t *testing.T) { testCheckAzureRMApiManagementExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -177,11 +165,7 @@ func TestAccAzureRMApiManagement_signInSignUpSettings(t *testing.T) { testCheckAzureRMApiManagementExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -200,11 +184,7 @@ func TestAccAzureRMApiManagement_policy(t *testing.T) { testCheckAzureRMApiManagementExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), { Config: testAccAzureRMApiManagement_policyXmlLink(data), Check: resource.ComposeTestCheckFunc( @@ -225,11 +205,7 @@ func TestAccAzureRMApiManagement_policy(t *testing.T) { testCheckAzureRMApiManagementExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_user_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_user_test.go index 956ad2c83ab7..7b419a093945 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_user_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_user_test.go @@ -28,11 +28,7 @@ func TestAccAzureRMApiManagementUser_basic(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "last_name", "Test"), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/appconfiguration/tests/resource_arm_app_configuration_test.go b/azurerm/internal/services/appconfiguration/tests/resource_arm_app_configuration_test.go index 8bda1879cd2a..785b7daa0de1 100644 --- a/azurerm/internal/services/appconfiguration/tests/resource_arm_app_configuration_test.go +++ b/azurerm/internal/services/appconfiguration/tests/resource_arm_app_configuration_test.go @@ -85,11 +85,7 @@ func TestAccAzureAppConfiguration_free(t *testing.T) { testCheckAzureAppConfigurationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -108,11 +104,7 @@ func TestAccAzureAppConfiguration_standard(t *testing.T) { testCheckAzureAppConfigurationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -154,11 +146,7 @@ func TestAccAzureAppConfiguration_complete(t *testing.T) { testCheckAzureAppConfigurationExists(data.ResourceName), ), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -245,12 +233,12 @@ func testCheckAzureAppConfigurationExists(resourceName string) resource.TestChec func testAccAzureAppConfiguration_free(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } resource "azurerm_app_configuration" "test" { - name = "testaccappconf%d" + name = "testacc-appconf%d" resource_group_name = "${azurerm_resource_group.test.name}" location = "${azurerm_resource_group.test.location}" sku = "free" @@ -261,7 +249,7 @@ resource "azurerm_app_configuration" "test" { func testAccAzureAppConfiguration_standard(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -292,7 +280,7 @@ resource "azurerm_app_configuration" "import" { func testAccAzureAppConfiguration_complete(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -312,7 +300,7 @@ resource "azurerm_app_configuration" "test" { func testAccAzureAppConfiguration_completeUpdated(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_job_schedule_test.go b/azurerm/internal/services/automation/tests/resource_arm_automation_job_schedule_test.go index b80e23057658..ff9788215b96 100644 --- a/azurerm/internal/services/automation/tests/resource_arm_automation_job_schedule_test.go +++ b/azurerm/internal/services/automation/tests/resource_arm_automation_job_schedule_test.go @@ -26,11 +26,7 @@ func TestAccAzureRMAutomationJobSchedule_basic(t *testing.T) { Config: testAccAzureRMAutomationJobSchedule_basic(data), Check: checkAccAzureRMAutomationJobSchedule_basic(data.ResourceName), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -47,11 +43,7 @@ func TestAccAzureRMAutomationJobSchedule_complete(t *testing.T) { Config: testAccAzureRMAutomationJobSchedule_complete(data), Check: checkAccAzureRMAutomationJobSchedule_complete(data.ResourceName), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } @@ -76,11 +68,7 @@ func TestAccAzureRMAutomationJobSchedule_update(t *testing.T) { Config: testAccAzureRMAutomationJobSchedule_basic(data), Check: checkAccAzureRMAutomationJobSchedule_basic(data.ResourceName), }, - { - ResourceName: data.ResourceName, - ImportState: true, - ImportStateVerify: true, - }, + data.ImportStep(), }, }) } diff --git a/azurerm/internal/services/batch/tests/data_source_batch_certificate_test.go b/azurerm/internal/services/batch/tests/data_source_batch_certificate_test.go index 460b8ed455e9..7fb6091bf801 100644 --- a/azurerm/internal/services/batch/tests/data_source_batch_certificate_test.go +++ b/azurerm/internal/services/batch/tests/data_source_batch_certificate_test.go @@ -10,14 +10,13 @@ import ( func TestAccDataSourceAzureRMBatchCertificate_basic(t *testing.T) { data := acceptance.BuildTestData(t, "data.azurerm_batch_certificate", "test") - config := testAccDataSourceAzureRMBatchCertificate_basic(data) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, Providers: acceptance.SupportedProviders, Steps: []resource.TestStep{ { - Config: config, + Config: testAccDataSourceAzureRMBatchCertificate_basic(data), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(data.ResourceName, "name", "sha1-42c107874fd0e4a9583292a2f1098e8fe4b2edda"), resource.TestCheckResourceAttr(data.ResourceName, "account_name", fmt.Sprintf("testaccbatch%s", data.RandomString)), diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_channel_email_test.go b/azurerm/internal/services/bot/tests/resource_arm_bot_channel_email_test.go index a65e7baa30b0..8316ad0db9d2 100644 --- a/azurerm/internal/services/bot/tests/resource_arm_bot_channel_email_test.go +++ b/azurerm/internal/services/bot/tests/resource_arm_bot_channel_email_test.go @@ -19,7 +19,6 @@ func TestAccAzureRMBotChannelEmail_basic(t *testing.T) { t.Skip("Skipping as one of `ARM_TEST_EMAIL`, AND `ARM_TEST_EMAIL_PASSWORD` was not specified") } data := acceptance.BuildTestData(t, "azurerm_bot_channel_email", "test") - config := testAccAzureRMBotChannelEmail_basicConfig(data) resource.Test(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -27,7 +26,7 @@ func TestAccAzureRMBotChannelEmail_basic(t *testing.T) { CheckDestroy: testCheckAzureRMBotChannelEmailDestroy, Steps: []resource.TestStep{ { - Config: config, + Config: testAccAzureRMBotChannelEmail_basicConfig(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMBotChannelEmailExists(data.ResourceName), ), @@ -45,8 +44,6 @@ func TestAccAzureRMBotChannelEmail_update(t *testing.T) { t.Skip("Skipping as one of `ARM_TEST_SLACK_CLIENT_ID`, `ARM_TEST_SLACK_CLIENT_SECRET`, or `ARM_TEST_SLACK_VERIFICATION_TOKEN` was not specified") } data := acceptance.BuildTestData(t, "azurerm_bot_channel_email", "test") - config := testAccAzureRMBotChannelEmail_basicConfig(data) - config2 := testAccAzureRMBotChannelEmail_basicUpdate(data) resource.Test(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -54,14 +51,14 @@ func TestAccAzureRMBotChannelEmail_update(t *testing.T) { CheckDestroy: testCheckAzureRMBotChannelEmailDestroy, Steps: []resource.TestStep{ { - Config: config, + Config: testAccAzureRMBotChannelEmail_basicConfig(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMBotChannelEmailExists(data.ResourceName), ), }, data.ImportStep("email_password"), { - Config: config2, + Config: testAccAzureRMBotChannelEmail_basicUpdate(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMBotChannelEmailExists(data.ResourceName), ), @@ -73,6 +70,9 @@ func TestAccAzureRMBotChannelEmail_update(t *testing.T) { func testCheckAzureRMBotChannelEmailExists(name string) resource.TestCheckFunc { return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Bot.ChannelClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + // Ensure we have enough information in state to look up in API rs, ok := s.RootModule().Resources[name] if !ok { @@ -85,9 +85,6 @@ func testCheckAzureRMBotChannelEmailExists(name string) resource.TestCheckFunc { return fmt.Errorf("Bad: no resource group found in state for Bot Channel Email") } - client := acceptance.AzureProvider.Meta().(*clients.Client).Bot.ChannelClient - ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext - resp, err := client.Get(ctx, resourceGroup, botName, string(botservice.ChannelNameEmailChannel)) if err != nil { return fmt.Errorf("Bad: Get on botChannelClient: %+v", err) diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_test.go b/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_test.go index 64ab33d491d9..8c07fcb387b7 100644 --- a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_test.go +++ b/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_test.go @@ -70,7 +70,7 @@ locals { } resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_extension_test.go b/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_extension_test.go index 0cf8e90d9715..9f41ca183490 100644 --- a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_extension_test.go +++ b/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_extension_test.go @@ -444,7 +444,7 @@ resource "azurerm_virtual_machine_scale_set_extension" "import" { func testAccAzureRMVirtualMachineScaleSetExtension_templateLinux(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -505,7 +505,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" { func testAccAzureRMVirtualMachineScaleSetExtension_templateWindows(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_test.go b/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_test.go index 66953cb2669c..8e500021c4b1 100644 --- a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_test.go +++ b/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_test.go @@ -74,7 +74,7 @@ locals { } resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/containers/tests/resource_arm_container_registry_test.go b/azurerm/internal/services/containers/tests/resource_arm_container_registry_test.go index dc4f9114755d..c80d452f78aa 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_container_registry_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_container_registry_test.go @@ -481,7 +481,7 @@ func testCheckAzureRMContainerRegistryGeoreplications(resourceName string, sku s func testAccAzureRMContainerRegistry_basic_basic(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -501,7 +501,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_basicManaged(data acceptance.TestData, sku string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -532,7 +532,7 @@ resource "azurerm_container_registry" "import" { func testAccAzureRMContainerRegistry_complete(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -553,7 +553,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_completeUpdated(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -574,7 +574,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_geoReplication(data acceptance.TestData, sku string, georeplicationLocations string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -591,7 +591,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_geoReplicationUpdateWithNoLocation(data acceptance.TestData, sku string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -607,7 +607,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_geoReplicationUpdateWithNoLocation_basic(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -627,7 +627,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_networkAccessProfile_ip(data acceptance.TestData, sku string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%[1]d" + name = "acctestRG-%[1]d" location = "%[2]s" } @@ -658,7 +658,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_networkAccessProfile_vnet(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%[1]d" + name = "acctestRG-%[1]d" location = "%[2]s" } @@ -705,7 +705,7 @@ resource "azurerm_container_registry" "test" { func testAccAzureRMContainerRegistry_networkAccessProfile_both(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%[1]d" + name = "acctestRG-%[1]d" location = "%[2]s" } diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_sql_server_test.go b/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_sql_server_test.go index 18f459efa391..c6719a36a963 100644 --- a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_sql_server_test.go +++ b/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_sql_server_test.go @@ -49,6 +49,9 @@ func TestAccAzureRMDataFactoryLinkedServiceSQLServer_basic(t *testing.T) { func testCheckAzureRMDataFactoryLinkedServiceSQLServerExists(name string) resource.TestCheckFunc { return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).DataFactory.LinkedServiceClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + // Ensure we have enough information in state to look up in API rs, ok := s.RootModule().Resources[name] if !ok { @@ -62,9 +65,6 @@ func testCheckAzureRMDataFactoryLinkedServiceSQLServerExists(name string) resour return fmt.Errorf("Bad: no resource group found in state for Data Factory: %s", name) } - client := acceptance.AzureProvider.Meta().(*clients.Client).DataFactory.LinkedServiceClient - ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext - resp, err := client.Get(ctx, resourceGroup, dataFactoryName, name, "") if err != nil { return fmt.Errorf("Bad: Get on dataFactoryLinkedServiceClient: %+v", err) diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_account_test.go b/azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_account_test.go index fa29a489e599..06ed3d3caf0f 100644 --- a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_account_test.go +++ b/azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_account_test.go @@ -52,10 +52,7 @@ func TestAccAzureRMDataLakeAnalyticsAccount_requiresImport(t *testing.T) { testCheckAzureRMDataLakeAnalyticsAccountExists(data.ResourceName), ), }, - { - Config: testAccAzureRMDataLakeAnalyticsAccount_requiresImport(data), - ExpectError: acceptance.RequiresImportError("azurerm_data_lake_analytics_account"), - }, + data.RequiresImportErrorStep(testAccAzureRMDataLakeAnalyticsAccount_requiresImport), }, }) } diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_schedule_test.go b/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_schedule_test.go index 7893e29f7815..504db94aa5af 100644 --- a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_schedule_test.go +++ b/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_schedule_test.go @@ -162,7 +162,7 @@ func testCheckAzureRMDevTestLabScheduleDestroy(s *terraform.State) error { func testAccAzureRMDevTestLabSchedule_autoShutdownBasic(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -197,7 +197,7 @@ resource "azurerm_dev_test_schedule" "test" { func testAccAzureRMDevTestLabSchedule_autoShutdownBasicUpdate(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -235,7 +235,7 @@ resource "azurerm_dev_test_schedule" "test" { func testAccAzureRMDevTestLabSchedule_autoStartupBasic(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -273,7 +273,7 @@ resource "azurerm_dev_test_schedule" "test" { func testAccAzureRMDevTestLabSchedule_autoStartupBasicUpdate(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -314,7 +314,7 @@ resource "azurerm_dev_test_schedule" "test" { func testAccAzureRMDevTestLabSchedule_concurrent(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go b/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go index a197a9acad7f..8a7683698003 100644 --- a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go +++ b/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go @@ -172,7 +172,7 @@ func testCheckAzureRMFrontDoorDestroy(s *terraform.State) error { func testAccAzureRMFrontDoor_basic(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -285,7 +285,7 @@ resource "azurerm_frontdoor" "import" { func testAccAzureRMFrontDoor_complete(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } @@ -346,7 +346,7 @@ resource "azurerm_frontdoor" "test" { func testAccAzureRMFrontDoor_waf(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go index c09255fafbdd..16e9bd7ecd5e 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go @@ -53,10 +53,7 @@ func testAccAzureRMExpressRouteCircuitPeering_requiresImport(t *testing.T) { testCheckAzureRMExpressRouteCircuitPeeringExists(data.ResourceName), ), }, - { - Config: testAccAzureRMExpressRouteCircuitPeering_requiresImportConfig(data), - ExpectError: acceptance.RequiresImportError("azurerm_express_route_circuit_peering"), - }, + data.RequiresImportErrorStep(testAccAzureRMExpressRouteCircuitPeering_requiresImportConfig), }, }) } diff --git a/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go index b63f080d2a45..7c8bb3bf83b0 100644 --- a/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go @@ -250,7 +250,7 @@ resource "azurerm_point_to_site_vpn_gateway" "test" { func testAccAzureRMAzureRMPointToSiteVPNGateway_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go index 28edba603616..77b22318bffe 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go @@ -283,7 +283,7 @@ resource "azurerm_virtual_hub" "test" { func testAccAzureRMVirtualHub_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go index bb3fcbf71b67..42bb9cd4fbfa 100644 --- a/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go @@ -288,7 +288,7 @@ resource "azurerm_vpn_gateway" "test" { func testAccAzureRMVPNGateway_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go b/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go index 3d38a19d0711..54bb7ea7dd89 100644 --- a/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go @@ -441,7 +441,7 @@ EOF func testAccAzureRMAzureRMVPNServerConfiguration_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go index e4a61f2cc5e2..71f3e4f522ca 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go @@ -316,7 +316,7 @@ resource "azurerm_storage_share_directory" "child" { func testAccAzureRMStorageShareDirectory_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go index 5b1911f4142d..13aea750d856 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go @@ -235,7 +235,7 @@ resource "azurerm_storage_table_entity" "test" { func testAccAzureRMTableEntity_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestrg-%d" + name = "acctestRG-%d" location = "%s" } diff --git a/azurerm/internal/services/web/resource_arm_app_service.go b/azurerm/internal/services/web/resource_arm_app_service.go index 9ea6454b7a03..b2b68dd38e6c 100644 --- a/azurerm/internal/services/web/resource_arm_app_service.go +++ b/azurerm/internal/services/web/resource_arm_app_service.go @@ -26,6 +26,7 @@ func resourceArmAppService() *schema.Resource { Read: resourceArmAppServiceRead, Update: resourceArmAppServiceUpdate, Delete: resourceArmAppServiceDelete, + Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error { _, err := ParseAppServiceID(id) return err diff --git a/website/docs/r/app_service_virtual_network_association.html.markdown b/website/docs/r/app_service_virtual_network_association.html.markdown index 97f7972e2f96..3946b1fb1bbd 100644 --- a/website/docs/r/app_service_virtual_network_association.html.markdown +++ b/website/docs/r/app_service_virtual_network_association.html.markdown @@ -16,7 +16,7 @@ Manages an App Service Virtual Network Association (this is for the [Regional VN ```hcl resource "azurerm_resource_group" "test" { - name = "acctestrg" + name = "acctestRG" location = "uksouth" }