Skip to content

Azure Blob Storage To OTel Terraform Module

Using our Terraform modules, you can easily install and manage Coralogix integrations with Azure services as modules in your infrastructure code. This tutorial demonstrates how to install the Coralogix function app, allowing you to connect your Blob Storage container and send logs to OTel Endpoint.

This function serves as a solution for the limitation of azureblobreceiver in OpenTelemetry Collector, as it can't process non-JSON logs (see this issue).

Our modules are open-source and available on Github and in the Terraform registry.

Prerequisites

  • Azure account with an active subscription.

  • Storage account where logs are stored with event notifications configured with EventHub as a destination.

  • An OTel collector endpoint (available for the function app to reach).

  • [Optional] vNet network with a subnet for the function app if you are using a Premium App Service Plan.

Installation

Install our function app that connects to your Blob Storage container and sends logs to OTel Endpoint.

Add this declaration to your Terraform project:

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "~> 3.93"
    }
  }
}

provider "azurerm" {
  features {}
}

# Standard version without vNet integration
module "blobtootel-standard" {
  source = "coralogix/azure/coralogix//modules/blobtootel"

  OtelEndpoint                   = "my-otel-endpoint.com:4318"
  FunctionResourceGroupName      = "my-function-resource-group"
  FunctionAppServicePlanType     = "Consumption"
  EventHubNamespace              = "my-eventhub-namespace"
  EventHubName                   = "my-eventhub-name"
  EventHubResourceGroup          = "my-eventhub-resource-group"
  BlobContainerStorageAccount    = "my-blob-container-storage-account"
  BlobContainerResourceGroupName = "my-blob-container-resource-group"
}

# Premium version with vNet integration (in case if there is a private connection to OTel endpoint)
module "blobtootel-vnet" {
  source = "coralogix/azure/coralogix//modules/blobtootel"

  OtelEndpoint                   = "my-otel-endpoint.com:4318"
  FunctionResourceGroupName      = "my-function-resource-group"
  FunctionAppServicePlanType     = "Premium"
  EventHubNamespace              = "my-eventhub-namespace"
  EventHubName                   = "my-eventhub-name"
  EventHubResourceGroup          = "my-eventhub-resource-group"
  BlobContainerStorageAccount    = "my-blob-container-storage-account"
  BlobContainerResourceGroupName = "my-blob-container-resource-group"
  VirtualNetworkName             = "my-virtual-network"
  SubnetName                     = "my-subnet"
  VirtualNetworkResourceGroup    = "my-virtual-network-resource-group"
}
  • Descriptions for variables can be found here.

Additional Resources

Documentation Coralogix Terraform Provider
External Documentation Github
Terraform Registry

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].