Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[Azure/Event Hub/Kafka] Using Event Hub instead of Kafka on the Azure Cloud.

Posted on May 22, 2025May 22, 2025 By nim No Comments on [Azure/Event Hub/Kafka] Using Event Hub instead of Kafka on the Azure Cloud.
╷
│ Error: creating Namespace (Subscription: "7f8e5acb-a937-4163-80b1-f874c3a4d62c"
│ Resource Group Name: "nimtechnology"
│ Namespace Name: "elearning-eventhub"): performing CreateOrUpdate: unexpected status 409 (409 Conflict) with error: MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.EventHub'. See https://aka.ms/rps-not-found for how to register subscriptions.
│ 
│   with module.event-hubs-kafka.azurerm_eventhub_namespace.eventhub_namespace,
│   on .terraform/modules/event-hubs-kafka/c5-eventhub-module.tf line 61, in resource "azurerm_eventhub_namespace" "eventhub_namespace":
│   61: resource "azurerm_eventhub_namespace" "eventhub_namespace" {
│ 
╵

Đâu tiên nếu chúng ta chưa đăng ký sử dụng Event Hub sẽ bị lỗi trên.
Chúng ta sẽ thực hiện đăng ký như sau:

Bạn tìm đến eventhub click vào:

Tiếp theo thì bạn sẽ chọn Subscription và Resource group
Namespace name nó là tên của event-hub rồi chọn region

Pricing tier: chúng ta có rất nhiều option

với từng Pricing tier chúng ta có nhưng setup khác nhau:

Với Dedicated thì chúng ta setup được cluster detail:

Với Premium chúng ta chỉ có thể setup thêm Processing Units

Với Standard thì chúng ta chỉ có setup Throughput Units

Chúng ta sẽ cùng nhau tìm hiểu CU (capacity unit), PU (processing unit), and TU (throughput unit)

Contents

Toggle
    • Summary Table
  • Apply service endpoint for EventHubs.
  • Apply Private Endpoint to Event Hubs

Summary Table

TierUnitIngress CapacityEgress CapacityMax Units per Namespace
StandardTUUp to 1 MB/sec or 1,000 events/secUp to 2 MB/sec or 4,096 events/sec40 TUs
PremiumPU~5–10 MB/sec~10–20 MB/sec16 PUs
DedicatedCU~100–200 MB/sec~100–200 MB/sec20 CUs

Key Differences:

  • Throughput Units (TU): Used in the Standard tier, suitable for general event streaming with moderate throughput needs.
  • Processing Units (PU): Used in the Premium tier, providing dedicated resources for high-throughput, low-latency workloads.
  • Capacity Units (CU): Used in the Dedicated tier, offering single-tenant resources for mission-critical workloads requiring high throughput.Microsoft Learn

Tiếp theo là đến tab advanced:

Phân networking chúng ta sẽ chọn public access hoặc private access:

Tiếp theo là tag và review + create

Sau đó chúng ta có 1 con event hubs:

Bạn có thể connect vào event hub thông qua domain ở đây với port 9093

và lấy passwork ở đây:
và username mặc định là $$ConnectionString

Bạn có thể kiểm tra connection như sau:

version: '3.6'

services:
  akhq:
    image: tchiotludo/akhq
    environment:
      AKHQ_CONFIGURATION: |
        akhq:
          connections:
            eventhub-terraform:
              properties:
                bootstrap.servers: "xxx-eventhub.servicebus.windows.net:9093"
                security.protocol: SASL_SSL
                sasl.mechanism: PLAIN
                sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username='$$ConnectionString' password='Endpoint=sb://xxx-eventhub.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=otArEMfGxxxxxxxxxsmQF3qrsCml+AEhHuWnAg=';
    ports:
      - "8080:8080"
    restart: always

module "event-hubs-kafka" {
  source  = "azure-terraform-module/event-hubs-kafka/azure"
  version = "0.0.2"
  namespace         = "elearning-eventhub" # Must be unique name
  resource_group_name   = var.resource_group_name
  location              = var.resource_group_location
  network_mode = "public"
  tags = {
    environment = "dev"
    project     = "elearning"
  }
}

Apply service endpoint for EventHubs.

Bạn có thể tham khảo bài viết này để hiểu hơn về Service Endpoint

[Service Endpoint] Explain the Service Endpoint in Azure VNet.

Và bạn có sử thể sử dụng terraform config sau để apply:

module "event-hubs-kafka" {
 source  = "azure-terraform-module/event-hubs-kafka/azure"
 version = "0.0.4"
 namespace         = "elearning-eventhub" # Must be unique name
 resource_group_name   = var.resource_group_name
 location              = var.resource_group_location
 network_mode = "service"
 subnet_ids   = module.vnet.subnet_ids
 tags = {
   environment = "dev"
   project     = "elearning"
 }
}

ở đây thì bạn cần khai báo network_mode và subnet_ids

Lúc này bạn vào kiểm tra Networking thấy hiện như trên là ok.
để Endpoint status enable thì bạn sẽ cần sang thêm subnet và chỉ định EventHubs trong phần Service.

Apply Private Endpoint to Event Hubs

Để apply private endpoint cho event hubs đầu tiên bạn nên chỉnh Public access bằng disabled.

Sau đó bạn cấu hình Private DNS rồi map với private endpoint connections.

Lúc này bạn sẽ thấy nó sẽ tạo domain private cho event hubs và nó sẽ lấy 1 IP private trong subnet.

Tất cả sẽ đơn giản nếu bạn sử dụng terraform sau:

module "event-hubs-kafka" {
  source  = "azure-terraform-module/event-hubs-kafka/azure"
  version = "0.0.5"
  namespace         = "elearning-eventhub" # Must be unique name
  resource_group_name   = var.resource_group_name
  location              = var.resource_group_location
  network_mode = "private"
  vnet_ids = [module.vnet.vnet_id]
  subnet_ids   = [module.vnet.subnet_ids[1]]
  tags = {
    environment = "dev"
    project     = "elearning"
  }
}
Azure Cloud, Kafka

Post navigation

Previous Post: [Azure/Resource Group] Create Resource Group on azure cloud
Next Post: [Linux Tips] Be Careful When Using the chown Command on Alpine Linux 3.21 – Don’t Use the Dot Anymore!

More Related Articles

[Kafka] Kafka Console Producer CLI. Apache Kafka
[Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ Azure Cloud
[Azure/MongoDB] Creating Azure Cosmos DB for MongoDB (RU) Azure Cloud
[Microsoft] How to disable Microsoft Entra multi-factor authentication MFA from an admin perspective Azure Cloud
[Kafka] This is how you produce and consume messages with Kafka Kafka
[Kafka] How many partitions are enough in a topic on Kafka? Kafka

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [WordPress] Hướng dấn gửi mail trên WordPress thông qua gmail. June 15, 2025
  • [Bitbucket] Git Clone/Pull/Push with Bitbucket through API Token. June 12, 2025
  • [Teamcity] How to transfer the value from pipeline A to pipeline B June 9, 2025
  • [Windows] Remove the process that consumes too much CPU. June 3, 2025
  • Deploying Web-Based File Managers: File Browser and KubeFileBrowser with Docker and Kubernetes June 3, 2025

Archives

  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.