Azure IoTHub Event Hub Endpoint Creation is Unreachable

David Maryo 126 Reputation points
2022-10-08T08:35:35.51+00:00

Creating Event Hub Endpoint via Terraform it shows the status as "Unreachable" and "Unauthorized". But the same Endpoint when created manually seems to be working fine as expected. I would like to know if this can be a bug or am I missing out something?

Event Hub Endpoint via Terraform:

resource "azurerm_iothub_endpoint_eventhub" "jd-endpoint" {  
  resource_group_name = data.azurerm_iothub.jd-iot.resource_group_name  
  iothub_id           = data.azurerm_iothub.jd-iot.id  
  name                = "jd-endpoint"  
  connection_string = azurerm_eventhub_authorization_rule.staging.primary_connection_string  
}  

Provider Version:

terraform {  
  required_providers {  
    azurerm = {  
      version = "~> 3.24.0"  
    }  
  }  

f2mU9.png

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
Azure Event Hubs
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 36,006 Reputation points Moderator
    2022-10-10T04:49:35.313+00:00

    @David Maryo

    But the same Endpoint when created manually seems to be working fine as expected.

    You mean, under IoT Hub routing?

    Can you please confirm, If the endpoint uses managed identity? If yes, please check that the IoT Hub principal has the required permissions on the target.

    248760-image.png

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.