Closed tobiasschueler closed 4 years ago
failing back to working version azurerm 1.41.0 for iothub
Fallback to azurerm 1.41.0 or to azurerm 1.40.0 did not work as well, same error.
I tested with 1.40.0 and later 1.41.0 both worked deploying against existing iothub as well as creating new...
Okay, get it working too with 1.41.0. But it should be fixed in a future version as well.
I am experiencing the same issue updating iot hub with provider azurerm 2.3.0 as well.
I am experiencing the same issue updating iot hub with provider azurerm 2.1.0
With provider 2.6.0 initial deployment is ok but any update produce the same error.
Is anybody working on this? This bug basically breaks the provider when using iothub
I've open a separate issue for version 2.x few weeks ago : https://github.com/terraform-providers/terraform-provider-azurerm/issues/6595 My PR that fix this using the latest api version was merged, so it should be good in 2.10
Thanks for opening this issue. I assume this issue has been fixed since I cannot repro it with latest azurerm and below tfconfig. Could you have a try to check whether the issue still exists? Thanks.
First apply:
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-iothub-test03"
location = "eastus2"
}
resource "azurerm_storage_account" "test" {
name = "acctestsatest03"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_container" "test" {
name = "testsc03"
storage_account_name = azurerm_storage_account.test.name
container_access_type = "private"
}
resource "azurerm_eventhub_namespace" "test" {
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
name = "acctest-test03"
sku = "Basic"
}
resource "azurerm_eventhub" "test" {
name = "acctest03"
resource_group_name = azurerm_resource_group.test.name
namespace_name = azurerm_eventhub_namespace.test.name
partition_count = 2
message_retention = 1
}
resource "azurerm_eventhub_authorization_rule" "test" {
resource_group_name = azurerm_resource_group.test.name
namespace_name = azurerm_eventhub_namespace.test.name
eventhub_name = azurerm_eventhub.test.name
name = "acctest"
send = true
}
resource "azurerm_iothub" "test" {
name = "acctestIoTHub-test03"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku {
name = "S1"
capacity = "1"
}
event_hub_retention_in_days = 7
event_hub_partition_count = 77
endpoint {
type = "AzureIotHub.StorageContainer"
connection_string = azurerm_storage_account.test.primary_blob_connection_string
name = "export"
batch_frequency_in_seconds = 60
max_chunk_size_in_bytes = 10485760
container_name = azurerm_storage_container.test.name
encoding = "Avro"
file_name_format = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"
}
endpoint {
type = "AzureIotHub.EventHub"
connection_string = azurerm_eventhub_authorization_rule.test.primary_connection_string
name = "export2"
}
route {
name = "export"
source = "DeviceMessages"
condition = "true"
endpoint_names = ["export"]
enabled = true
}
route {
name = "device-twin-changed-eventhub-queue"
source = "TwinChangeEvents"
condition = "true"
endpoint_names = ["export2"]
enabled = true
}
route {
name = "export2"
source = "DeviceMessages"
condition = "true"
endpoint_names = ["export2"]
enabled = true
}
file_upload {
connection_string = azurerm_storage_account.test.primary_blob_connection_string
container_name = azurerm_storage_container.test.name
notifications = true
max_delivery_count = 12
sas_ttl = "PT2H"
default_ttl = "PT3H"
lock_duration = "PT5M"
}
tags = {
purpose = "testing"
}
}
Second apply:
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-iothub-test03"
location = "eastus2"
}
resource "azurerm_storage_account" "test" {
name = "acctestsatest03"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_container" "test" {
name = "testsc03"
storage_account_name = azurerm_storage_account.test.name
container_access_type = "private"
}
resource "azurerm_eventhub_namespace" "test" {
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
name = "acctest-test03"
sku = "Basic"
}
resource "azurerm_eventhub" "test" {
name = "acctest03"
resource_group_name = azurerm_resource_group.test.name
namespace_name = azurerm_eventhub_namespace.test.name
partition_count = 2
message_retention = 1
}
resource "azurerm_eventhub_authorization_rule" "test" {
resource_group_name = azurerm_resource_group.test.name
namespace_name = azurerm_eventhub_namespace.test.name
eventhub_name = azurerm_eventhub.test.name
name = "acctest"
send = true
}
resource "azurerm_iothub" "test" {
name = "acctestIoTHub-test03"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku {
name = "S1"
capacity = "1"
}
event_hub_retention_in_days = 7
event_hub_partition_count = 77
endpoint {
type = "AzureIotHub.StorageContainer"
connection_string = azurerm_storage_account.test.primary_blob_connection_string
name = "export"
batch_frequency_in_seconds = 60
max_chunk_size_in_bytes = 10485760
container_name = azurerm_storage_container.test.name
encoding = "Avro"
file_name_format = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"
}
endpoint {
type = "AzureIotHub.EventHub"
connection_string = azurerm_eventhub_authorization_rule.test.primary_connection_string
name = "export2"
}
route {
name = "device-twin-changed-eventhub-queue"
source = "TwinChangeEvents"
condition = "true"
endpoint_names = ["export2"]
enabled = true
}
tags = {
purpose = "testing"
}
}
👋
Since we've not heard back from you here I'm going to close this issue for the moment - but please let us know if you're able to take a look at the comment above and confirm if this is still an issue and we'll take another look.
Thanks!
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!
Community Note
Terraform (and AzureRM Provider) Version
Terraform 0.12.20 azurerm 1.42.0
Affected Resource(s)
azurerm_iothub
Terraform Configuration Files
Expected Behavior
file_upload
configurationdebug message
route configurationActual Behavior
While updating the ressource, an API error appears:
Error: Error creating/updating IotHub "vg-iothub-dev" (Resource Group "iothub-dev"): devices.IotHubResourceClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="Failed" Message="The async operation failed." InnerError={"unmarshalError":"json: cannot unmarshal number into Go struct field serviceError2.code of type string"} AdditionalInfo=[{"code":404010,"httpStatusCode":"NotFound","message":"Default eventHub endpoint 'operationsMonitoringEvents' is missing from the EventHub Endpoints. If you contact a support representative please include this correlation identifier: ea2ef0f2-87e9-44d2-bae5-f0b940640841, timestamp: 2020-02-04 09:16:59Z, errorcode: IH404010."}]
Steps to Reproduce
terraform apply
Important Factoids
Azure Germany, location
westeurope
.Own Investigations
The
operationsMonitoringEvents
endpoint is no longer supported by Azure (03/2019). It seems that the provider is using an outdated API to create/updating IoTHub ressources.