hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

azurerm_eventgrid_system_topic. Activity Logs Error: Get FullUrl of SystemTopic EventSubscription #25977

Open uakharkivponomarov opened 5 months ago

uakharkivponomarov commented 5 months ago

Is there an existing issue for this?

Community Note

Terraform Version

0.12.31

AzureRM Provider Version

3.100.0

Affected Resource(s)/Data Source(s)

azurerm_eventgrid_system_topic

Terraform Configuration Files

resource "azurerm_eventgrid_system_topic" "sa_public_device_logs" {
  name                   = local.eventgrid_sys_topic_name
  location               = var.azure_region_full
  resource_group_name    = module.name_generator.resource_group_name_main
  source_arm_resource_id = module.sa_public_device_logs.storage_account_id
  topic_type             = "Microsoft.Storage.StorageAccounts"
  tags                   = var.tags_list

  identity {
    type = "SystemAssigned"
  }
}

resource "azurerm_eventgrid_system_topic_event_subscription" "event_hub" {
  name                                 = local.eventgrid_sys_topic_event_subscription_name
  advanced_filtering_on_arrays_enabled = true
  system_topic                         = azurerm_eventgrid_system_topic.sa_public_device_logs.name
  resource_group_name                  = module.name_generator.resource_group_name_main
  eventhub_endpoint_id                 = azurerm_eventhub.device_logs.id
  included_event_types                 = ["Microsoft.Storage.BlobCreated"]
  delivery_identity {
    type = "SystemAssigned"
  }
}

Debug Output/Panic Output

Azure Activity Logs for Event Grid System Topic:
Error code: InvalidRequest
Message:    Destination type of the event subscription XXXX is EventHub which doesn't support full URL. Only webhook destination type supports full URL.

Expected Behaviour

We no longer encounter the "Get FullUrl of SystemTopic EventSubscription" error in the Azure Activity Log following each infrastructure deployment.

Actual Behaviour

Although we have configured the EventHub as an endpoint for the Event Subscription of our Event Grid System Topic, it still requests a Full URL as if it is a Webhook endpoint.

Steps to Reproduce

terraform apply

Support team helped to investigate the issue. Here is the result: the terraform is trying to perform the following action which is causing the bad request because the Event hub endpoint does not support the action:

Microsoft.EventGrid/systemTopics/eventSubscriptions/getFullUrl/action

Important Factoids

Germany

References

No response

marcin-sg commented 3 months ago

Exactly the same behavior for azurerm_eventgrid_event_subscription - every terraform plan pollutes activity logs with error messages.

Terraform v1.8.4 on linux_amd64 + provider registry.terraform.io/hashicorp/azurerm v3.114.0

miketrebilcock commented 1 week ago

We've just started seeing a similar problem:

azurerm: 3.92.0

Destination type of the event subscription [SubscriptionName] is AzureFunction which doesn't support full URL. Only webhook destination type supports full URL.