Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage_account - ATP not available in Azure Germany #4563

Closed
sigv opened this issue Oct 8, 2019 · 3 comments · Fixed by #4564
Closed

storage_account - ATP not available in Azure Germany #4563

sigv opened this issue Oct 8, 2019 · 3 comments · Fixed by #4564

Comments

@sigv
Copy link
Contributor

sigv commented Oct 8, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.11.14
+ provider.azurerm v1.35.0

Affected Resource(s)

  • azurerm_storage_account

Terraform Configuration Files

resource "azurerm_resource_group" "primary" {
  name     = "ABC"
  location = "Germany Central"
}

resource "azurerm_storage_account" "storagestandard" {
  name                              = "destoragestandard"
  resource_group_name               = "${azurerm_resource_group.primary.name}"
  location                          = "${azurerm_resource_group.primary.location}"
  account_kind                      = "StorageV2"
  account_tier                      = "Standard"
  account_replication_type          = "LRS"
  enable_https_traffic_only         = true
  enable_advanced_threat_protection = false
}

Error Output

Error: Error refreshing state: 1 error occurred:
        * azurerm_storage_account.storagestandard: 1 error occurred:
        * azurerm_storage_account.storagestandard: azurerm_storage_account.storagestandard: Error reading the advanced threat protection settings of AzureRM Storage Account "destoragestandard": security.AdvancedThreatProtectionClient#Get: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="InvalidResourceNamespace" Message="The resource namespace 'Microsoft.Security' is invalid."

Expected Behavior

enable_advanced_threat_protection is ignored as not available in Azure Germany.

Actual Behavior

Any action involving the storage account fails with a HTTP/2.0 404 Not Found on the AzureRM Response for the APT resource.

Steps to Reproduce

terraform apply / terraform refresh -target=azurerm_storage_account.storagestandard

Important Factoids

Specific to Azure Germany.

Our environments in regular AzureCloud do not have trouble with this.

References

sigv added a commit to sigv/terraform-provider-azurerm that referenced this issue Oct 8, 2019
The Azure Germany Cloud returns `HTTP/2.0 404 Not Found` whe
requesting the ATP details. In particular,

```
Code="InvalidResourceNamespace"
Message="The resource namespace 'Microsoft.Security' is invalid."
```

As we are simply ignoring the error on Azure Government based
on hashicorp#3920, we can apply the same logic for Azure Germany.

Closes hashicorp#4563.
sigv added a commit to sigv/terraform-provider-azurerm that referenced this issue Oct 8, 2019
The Azure Germany Cloud returns `HTTP/2.0 404 Not Found` when
requesting the ATP details. In particular,

```
Code="InvalidResourceNamespace"
Message="The resource namespace 'Microsoft.Security' is invalid."
```

As we are simply ignoring the error on Azure Government based
on hashicorp#3920, we can apply the same logic for Azure Germany.

Closes hashicorp#4563.
@sigv
Copy link
Contributor Author

sigv commented Oct 8, 2019

PR #4564 submitted based on how #3947 was done.

katbyte pushed a commit that referenced this issue Oct 9, 2019
The Azure Germany Cloud returns `HTTP/2.0 404 Not Found` when
requesting the ATP details. In particular,

```
Code="InvalidResourceNamespace"
Message="The resource namespace 'Microsoft.Security' is invalid."
```

As we are simply ignoring the error on Azure Government based
on #3920, we can apply the same logic for Azure Germany.

Closes #4563.
@katbyte katbyte added this to the v1.36.0 milestone Oct 9, 2019
@ghost
Copy link

ghost commented Oct 29, 2019

This has been released in version 1.36.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.36.0"
}
# ... other configuration ...

sigv added a commit to sigv/terraform-provider-azurerm that referenced this issue Oct 29, 2019
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.
@ghost
Copy link

ghost commented Nov 9, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants