-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Bug suspected in Microsoft API when enabling storage threat protection - error parsing URI #10179
Comments
Thanks, I have the same problem with different versions of azurerm provider and terraform (2.14.0 and 0.12.29). Is it safe to manually update the state file ? Or should we wait for a fix ? |
Also happens when using TF 13 (13.5). |
Hi, For a production system, I'd wait for a fix unless it's preventing an urgent change. Hopefully you can test on a non-production system / take a backup of the state file etc if you needed to. |
…ID has a `/` prefix Fixes #10179
We were able to workaround this issue editing the state directly: FROM:
TO:
The problem is, every time someone runs the |
For us (Terraform 13.5, AzureRM 2.36.0) this was solved by upgrading to AzureRM 2.40.0 |
This has been released in version 2.43.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 = "~> 2.43.0"
}
# ... other configuration ... |
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 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
Terraform v0.12.30
provider.azurerm v2.42.0
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
Advanced Threat Protection should successfully be enabled for the given storage account
Actual Behaviour
Terraform errored with:
Error: [ERROR] Unable to parse Advanced Threat Protection Set ID "subscriptions/ece6...c45/resourceGroups/test_xyz_shared/providers/Microsoft.Storage/storageAccounts/xyzbusiness/providers/Microsoft.Security/advancedThreatProtectionSettings/current": Cannot parse Azure ID: parse "subscriptions/ece6...c45/resourceGroups/test_xyz_shared/providers/Microsoft.Storage/storageAccounts/xyzbusiness/providers/Microsoft.Security/advancedThreatProtectionSettings/current": invalid URI for request
Steps to Reproduce
terraform apply
Important Factoids
State file showed the resource as tainted and looking closely we can see the leading '/' is missing on the id (ignore the ...):
...
},
Updating the state file by adding the leading '/', re-running the apply and it works.
Noticed that the unit test in resourceid_test.go checks for missing leading '/' so can only assume that the Microsoft API is broken.
Whilst this may not be a terraform provider bug, the community here should be aware and also might be in a position to help.
References
The text was updated successfully, but these errors were encountered: