From fbd088d431c3c73c772894a3981154a6e0c6ed6d Mon Sep 17 00:00:00 2001 From: Valters Jansons Date: Tue, 29 Oct 2019 14:44:43 +0200 Subject: [PATCH] storage_account: Fix Azure Germany ATP matching Although the error message returned from Azure Germany Cloud is precisely "The resource namespace 'Microsoft.Security' is invalid." the error message we are seeing in `r/storage_account` has other contents added on it, so we cannot do an equals check directly. The ATP fix was being pushed as v1.36.0, but this change provides the actual resolution. Ref #4563, #4564. --- azurerm/resource_arm_storage_account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/resource_arm_storage_account.go b/azurerm/resource_arm_storage_account.go index 058f1a144657..3b7deb42cc92 100644 --- a/azurerm/resource_arm_storage_account.go +++ b/azurerm/resource_arm_storage_account.go @@ -1134,7 +1134,7 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err atp, err := advancedThreatProtectionClient.Get(ctx, d.Id()) if err != nil { msg := err.Error() - if msg != "The resource namespace 'Microsoft.Security' is invalid." { + if !strings.Contains(msg, "The resource namespace 'Microsoft.Security' is invalid.") { if !strings.Contains(msg, "No registered resource provider found for location '") { if !strings.Contains(msg, "' and API version '2017-08-01-preview' for type ") { return fmt.Errorf("Error reading the advanced threat protection settings of AzureRM Storage Account %q: %+v", name, err)