Skip to content

Commit

Permalink
storage_account: Fix Azure Germany ATP matching
Browse files Browse the repository at this point in the history
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 hashicorp#4563, hashicorp#4564.
  • Loading branch information
sigv committed Oct 29, 2019
1 parent 3f5f184 commit fbd088d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azurerm/resource_arm_storage_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fbd088d

Please sign in to comment.