Deploying Langfuse on Azure with Terraform

Langfuse on Azure with Terraform gives your platform team a reviewable, repeatable build in your own subscription. This page explains what the module provisions, which choices change cost and operations, and what to confirm first.

On this page

Deploying Langfuse on Azure with Terraform: when this path fits

This path fits an Azure-first organization that needs LLM tracing data kept inside its own Azure subscription. If your platform, identity and networking already live in Azure and your security team wants the Langfuse stack provisioned as infrastructure code, the Terraform route is a reasonable starting point. If your estate is mostly on another cloud, or you have no Terraform practice to run the stack afterward, a different deployment option may suit you better.

A self-hosted Langfuse deployment runs two application containers, Langfuse Web (UI and APIs) and Langfuse Worker (asynchronous event processing). Around them sit PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage. Each of these is a stateful component you will own after go-live. Langfuse documents Kubernetes with Helm or Terraform-based deployments on AWS, Azure and GCP as production options, so the Azure path is one of the supported routes, and the self-hosting documentation lists the component options for each.

Core Langfuse features are MIT licensed, and self-hosted deployments run the same codebase as Langfuse Cloud. That means the licensing question for an Azure deployment is mostly about which features you need, not about the core tracing, prompt management and evaluation functions. Features such as project-level RBAC, audit logs and data retention policies need an Enterprise license key, so confirm that list against your governance requirements before you design the subscription layout. Ask your team to confirm which Azure services, regions and identity settings your landing zone already mandates, since those choices determine how much of the module you can reuse as written.

Which Azure path fits your organization

This path provisions the Langfuse stack inside an Azure subscription you own, using the official Terraform module as the starting point. It is the option for organizations that want production-grade infrastructure in their own cloud account, with networking, identity and data stores defined as code and reviewed like any other change. Your platform or cloud team owns the stack after handover: the AKS cluster, the managed PostgreSQL and blob storage choices, upgrades, backups and cost.

  • Who operates it: your platform team runs the Kubernetes cluster and Azure resources, and your security team reviews identity, network and data handling.
  • Where it fits: organizations that need the data plane in their own subscription and already manage Azure through infrastructure as code.
  • Where it is the wrong choice: teams with no Kubernetes or Terraform capacity who expect someone else to patch the platform every month.
  • Cost shape: build effort is one-time, while cluster, database, storage and staffing costs recur. Ask for the list of provisioned resources in the written scope.
  • Ownership: you inherit module upgrades and any customization you add to it.

Confirm which Azure services your landing zone already allows and whether the module fits your network design before choosing this path.

How the Langfuse components sit inside the Azure subscription

The diagram starts with applications and the identity provider outside the subscription, which reach langfuse-web through the ingress path. Inside a virtual network, langfuse-web and langfuse-worker run on AKS and hand work to PostgreSQL, ClickHouse, Redis or Valkey, and Blob Storage. Confirm which of these services you run yourself and which are Azure managed, and decide whether private endpoints sit on the data stores and storage before you accept the module defaults.

Trust boundary, managed and self-run components, and the private endpoint decision point.

Azure service choices and when each fits

This table compares the main configuration decisions for a Langfuse deployment on Azure, from AKS ownership to where PostgreSQL, Blob Storage, ClickHouse and Redis or Valkey run. Read each row against your own platform standards, since the right choice usually depends on whether your organization already runs managed Azure services and networks. The main takeaway is that the version requirements for v4 apply to whichever option you pick, so confirm they are met before you commit.

DecisionWhen it fitsTrade-offWhat to confirm
AKS cluster ownership: new cluster created by the moduleGreenfield subscription or a team without an existing AKS platform to reuseThe module provisions and owns the cluster, so your team takes on cluster upgrades and node operationsWho patches node pools and the Kubernetes version, and whether your landing zone allows the module to create clusters
AKS cluster ownership: existing clusterYour platform team already runs AKS with ingress, policy and monitoring standardsLangfuse must fit your cluster conventions, and changes to shared namespaces need coordinationNamespace, ingress controller, storage class and network policy requirements the module must respect
PostgreSQL: Azure Database for PostgreSQLYou want a managed transactional database with backups handled by the cloud platformManaged service pricing and networking rules apply, and major version upgrades still need planningPostgreSQL 15 or later is required for v4, and the selected server version and private access model
PostgreSQL: bundled in the deploymentShort-lived test or proof-of-concept environments where a managed service is not yet approvedYour team owns backups, failover and patching of the database, which is harder to defend for productionWhether bundled data stores are acceptable under your data protection and availability policy
Blob Storage through the S3-compatible interfaceYour team wants one storage configuration pattern and can enable the S3-compatible access path on your storage accountCompatibility depends on account settings and credentials handling, so test event, media and export bucketsWhether the storage account supports the S3-compatible interface in your region, and how access keys are stored
Blob Storage through an alternative storage optionYour standards require a different storage path or you already run an approved object storeAdds configuration work and needs separate testing for event, media and export flowsSupported storage configuration for your chosen option in the current Langfuse self-hosting docs
ClickHouse placementDedicated cluster sized for trace volume, usually with the official operator or a managed option you have approvedAnalytical storage is the largest sizing driver, and backfills need extra disk headroomClickHouse 25.12 or later is required for v4, and the expected disk headroom for your data volume
Redis or Valkey placementManaged Azure cache or a self-run Valkey service that meets the Redis 7.0 or later requirementCache and queue availability affects ingestion, so placement and failover need an explicit designRedis 7.0 or later is required for v4, and the eviction policy and TLS settings your service supports
Network model: existing virtual networkHub-and-spoke or landing zone where subnets, private DNS and firewall rules are already governedRequires agreed address ranges, subnet delegation and routes before deployment startsSubnet sizes, private DNS zones, egress path and whether the database and storage will use private endpoints
Network model: new virtual networkIsolated workload subscription with no shared network dependencyYour team must integrate later with central connectivity, logging and inspectionAddress space that avoids overlaps with other networks, and how the new network will peer or route later

Setup sequence for the Azure module

This sequence takes a Langfuse deployment from a chosen version and subscription to a verified instance with its first trace recorded, so the platform team can hand it over to day-two operations with a documented configuration.

  1. Confirm the target Langfuse version and data store requirements

    Before touching Azure, the platform lead picks the Langfuse version and checks its data store requirements against the release notes and the upgrade guide. For v4, the vendor documentation calls for ClickHouse 25.12 or later (26.4 recommended), PostgreSQL 15 or later and Redis 7.0 or later, so these minimums decide which Azure services and images the module will deploy. Confirm the Helm chart and module version pairing in the module repository as well. Done when you have a written version record listing the Langfuse release, each data store version and the module tag you will pin.

  2. Choose the subscription and Azure region

    The cloud or platform owner selects the subscription that will hold the stack and the region where data will be stored and processed. Confirm that your subscription quotas cover the AKS node pools, PostgreSQL and storage the module creates, and that the region offers the managed services you need. Record any data residency constraints from your compliance team, since they affect where traces and prompts are stored. Done when the subscription ID, region and quota confirmation are recorded in your deployment notes.

  3. Prepare the Terraform state backend

    The infrastructure engineer creates a remote state store, typically a storage account container with restricted access, and enables state locking and versioning so that concurrent applies cannot corrupt the stack. Keep the state container in a separate subscription or resource group from the workload where practical, and limit who can read it, because state can hold sensitive values. Done when a test terraform init succeeds against the backend and a second user with the intended role can read the state while an unauthorized user cannot.

  4. Set networking and identity for the deployment

    The network and identity owners decide whether the module creates a new virtual network or reuses an existing one, then define the subnets for AKS, the PostgreSQL private connectivity and any private endpoints for storage. They also decide which Microsoft Entra ID group administers the cluster and which managed identity or service principal runs Terraform. Confirm that the planned address ranges do not overlap with corporate networks you must reach. Done when the subnet plan, address ranges and Terraform identity permissions are approved and written into the variable file.

  5. Apply the module and review the plan

    The engineer fills in the module variables for the pinned version, runs terraform plan and reviews every resource the plan proposes to create, including AKS, the database, storage and any network rules. Check that no resource is unexpectedly destroyed or replaced and that the names and regions match the decisions from earlier steps. Only then run terraform apply. Done when the apply completes without errors and the output lists the cluster, database and storage endpoints you expected.

  6. Configure DNS and TLS for the public endpoint

    The networking team points a DNS record at the ingress address created for Langfuse and issues a certificate for that name, either from a certificate authority your organization trusts or through the cluster's certificate tooling. Confirm the NEXTAUTH_URL value matches the exact public address users will open, since mismatches break sign-in. Done when the hostname resolves to the ingress, the certificate chain validates from a client outside the cluster and the browser opens the Langfuse sign-in page over HTTPS.

  7. Set application secrets and sign-in

    The platform engineer generates strong values for the encryption key, salt and database and storage credentials, then stores them in a secret manager and injects them into the deployment rather than writing them into variable files or Git. Configure the initial administrator and the chosen SSO provider, and decide whether password sign-in stays enabled during rollout. Done when the secrets are absent from the repository and state plan output, and a test administrator can sign in through the intended method.

  8. Verify web, worker health and first trace ingestion

    The operator checks that the Langfuse Web and Worker containers are running and that the health endpoints report the database, ClickHouse and cache connections as healthy. Then create a project, copy its API keys and send one test trace from a small script or an OpenTelemetry-instrumented application to the Langfuse OTLP endpoint. Confirm the trace appears in the UI within the expected window and that the worker logs show no processing errors. Done when a test trace is visible in the project with the expected input and output, and health checks stay green through a restart of the web pods.

  9. Record the configuration for day-two work

    The platform lead writes down the pinned Langfuse and module versions, the Azure resource names and regions, the state location, the secret locations and rotation owners, the backup settings for PostgreSQL and storage, and the upgrade path to the next major version. Store this record alongside the Terraform code so that operations, security and audit teams can review it. Done when the record is committed, reviewed by a second engineer and linked from the runbook for the stack.

How to customize the module without losing upgrades

The first decision is whether to fork the official Terraform module or wrap it from a parent configuration. A fork gives you full control over resources, including networking, AKS node pools and storage account settings, but every change you make becomes a merge task each time the module is updated. Wrapping keeps the module untouched and passes inputs through a parent root module, which is easier to upgrade but limits you to the variables the module exposes. Most teams with an existing landing zone should start with a wrapper and fork only when a required change cannot be expressed through inputs. Confirm in the module's variables file which settings you can reach without editing its source.

Reusing existing infrastructure is the most common customization and the one that changes upgrade cost most. If your organization already has a virtual network, a PostgreSQL flexible server or a storage account, check whether the module can accept those resource IDs or whether it always creates its own. Each reused resource adds a dependency you must keep working across module releases, such as subnet delegation, private DNS zones, firewall rules and the Blob container names Langfuse expects. Record every such dependency in your own repository so an upgrade review can test them first. Treat the cost of carrying changes as a recurring line item: each module release, each Langfuse release and each change to a shared network needs a plan run and a review by someone who knows the fork.

Upgrade timing depends on the kind of Langfuse release. Updates within a major version are non-disruptive and apply database migrations automatically at startup, so a routine patch can reach a running deployment without a separate migration step. Major upgrades, such as v3 to v4, change infrastructure and data models and follow dedicated migration guides, including ClickHouse and PostgreSQL version requirements. Before you change a pinned image tag or a module version, read the relevant guide in the Langfuse upgrade guide, take a backup of PostgreSQL and ClickHouse, and test the change in a non-production subscription. Ask your implementation partner, if you use one, to state in writing who owns merges from upstream and who runs the post-upgrade checks.

Identity, secrets and network controls to design

A Langfuse deployment in Azure holds prompts, traces and user data, so identity, secrets, network paths and telemetry need decisions before the Terraform module runs. The cards below cover the controls to design first and the points your team must confirm against the module and your own tenant.

Entra ID sign-in through Auth.js

Self-hosted Langfuse supports Azure AD or Entra ID through its Auth.js providers, so users can sign in with your corporate identity. Decide whether password sign-in stays enabled for break-glass access. Langfuse can also disable password sign-in or enforce SSO for given email domains, so confirm which domains must be covered before users are onboarded.

SSO docs

Domain-level SSO enforcement

Enforcing SSO for your email domains removes local accounts for those users, which closes a common gap where staff sign up with personal credentials. Check how the module passes the Auth.js provider settings and redirect URL into the deployment, and confirm that the redirect URL matches the app registration in Entra ID exactly.

Secrets in Azure Key Vault

The deployment needs database passwords, the NextAuth secret, encryption keys and storage credentials. Decide whether these live in Azure Key Vault and are injected into AKS, or in another secret store you already operate. Confirm how the module creates, rotates and grants access to these values, and who holds the Key Vault access policies.

Private connectivity to data stores

PostgreSQL, Redis or Valkey, ClickHouse and blob storage should be reachable only from the cluster subnets, not from the public internet. Decide whether to use private endpoints or VNet integration for each service, and plan the private DNS zones they require. Confirm the module's default network posture before you accept it into a regulated landing zone.

TLS at ingress

Users, SDKs and OpenTelemetry exporters all send data to the public Langfuse endpoint, so TLS termination must be designed with the ingress controller, certificate source and the host name. Decide whether certificates come from Azure-managed certificates, cert-manager or your internal CA, and confirm which TLS versions and ciphers your security standard requires.

Enterprise features and telemetry

Audit logs, RBAC roles, data retention policies and server-side masking need an Enterprise license key, so decide early whether you need them. Self-hosted Langfuse also sends usage telemetry unless it is turned off, which is a separate decision for OSS and Enterprise deployments. Document both choices before the security review.

License key docs

Questions teams ask before deploying Langfuse on Azure

What drives the cost and effort of a Langfuse build on Azure?

The biggest drivers are the Azure resources you choose, how you size them, how much networking review your landing zone needs, how much SSO and identity work is involved, and how much testing you require before go-live. Azure resources are billed to your subscription whatever the build method, so the quote should separate the cloud bill (recurring) from the one-time engineering work. Langfuse's scaling guide lists minimum resources of 2 CPU and 4 GiB for web, worker and PostgreSQL, 1 CPU and 1.5 GiB for Redis or Valkey, and 2 CPU and 8 GiB for ClickHouse, with at least 16 GiB of ClickHouse memory for larger deployments. Ask the provider to show the sizing assumptions behind each line of the written scope.

Can our internal platform team deploy Langfuse on Azure alone?

Often yes, if the team already runs Kubernetes or VMs, Terraform and Azure identity in production. The work spans AKS or another compute target, managed PostgreSQL, a ClickHouse store, Redis or Valkey, Blob Storage, private networking, DNS and TLS, and an identity integration. Langfuse documents Docker Compose on a single VM for testing only, so production needs the Kubernetes or Terraform path. Engineers should be comfortable with Terraform state handling, Azure role assignments and Kubernetes operations. Teams without those skills, or with no one to own the stack after launch, usually gain more from a fixed-scope partner engagement with a written handover.

How long does a Langfuse deployment on Azure take?

Duration depends on scope: how many environments you need, whether the landing zone already exists, how many data stores are new, and how long your security and identity approvals take. Approvals are often the longest step, so start them early. No fixed duration is published for this work, so ask for a written plan with phases, dependencies and the client tasks each phase needs. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

What do we need to provide before the Azure build starts?

Expect to provide a subscription or resource group with rights to create resources, an identity administrator who can register applications and configure SSO, DNS control for the public hostname, and a named approver for network and security exceptions. You will also need to confirm which Azure region, virtual network ranges and private endpoint policies apply, and who signs off on storage and database settings. Ask the provider to list these inputs in the scope so approvals are scheduled before the build begins.

Who handles Langfuse upgrades after go-live on Azure?

Ownership should be written into the scope before go-live. Langfuse says updates within a major version are non-disruptive and apply database migrations automatically at startup, while major upgrades follow dedicated migration guides and may change infrastructure. The v3 to v4 guide requires ClickHouse 25.12 or later, PostgreSQL 15 or later and Redis 7.0 or later. Your team can run upgrades, or you can take a retainer for upgrades, continuous testing and support. Confirm who tests each release, who approves major changes, and who keeps the Terraform module current.

Does the Langfuse Enterprise license add vendor support?

Yes, the vendor's Self-Hosted Enterprise plan adds a named support engineer, solutions architect access and a support SLA, and its pricing is custom. The license also unlocks features such as project-level RBAC, audit logs, data retention policies and SCIM provisioning. The core features and APIs are available under the MIT-licensed open source version without limits. Separately, DeployOpen's own work (planning, building, hardening and supporting the deployment) is quoted from a written scope and does not replace the vendor's support terms. Ask both parties to confirm what each one covers.

Which Azure identity and network choices affect security review?

Security reviewers usually focus on how users sign in, how the Langfuse services reach PostgreSQL, ClickHouse and Blob Storage, and whether traffic stays on private networks. Langfuse supports SSO through providers including Azure AD or Entra ID, and can disable password sign-in or enforce SSO for given email domains. Plan private endpoints, managed identities where the module supports them, restricted storage access and TLS for every data path. Confirm each choice against your own security baseline and the module version you deploy.

Who runs the stack after go-live

Go-live is the start of ownership, not the end of the project. After the Terraform module has stood up the AKS cluster, Azure Database for PostgreSQL, Blob Storage and networking, your team owns the scaling, backups, upgrades and monitoring of every component, and a partner engagement should say explicitly which of these it covers and which move to a retainer. Scale the Langfuse Worker deployment on CPU load, as the scaling guide recommends. Only if ingestion is heavy should you consider splitting langfuse-web into separate ingestion and user interface deployments, and that split is a change to the Kubernetes manifests you will need to maintain, so confirm who makes it and who tests it.

Backups are the part most often assumed rather than verified. Confirm that PostgreSQL backups (Azure's managed retention and point-in-time options) and ClickHouse backups are both configured, that a restore has been rehearsed into a separate environment, and that Blob Storage lifecycle and retention rules match what your data policy says. Monitoring covers the platform itself: alerts on pod restarts, database CPU and storage, and worker backlog. Check the Langfuse upgrade guide before each change, because updates within a major version apply database migrations automatically at startup.

Plan major upgrades as projects. The v3 to v4 guide requires ClickHouse 25.12 or later (26.4 recommended), PostgreSQL 15 or later and Redis 7.0 or later, and it moves to an observations-first data model with about 3x ClickHouse disk headroom for backfills. If you use the Helm chart's bundled data stores on AKS, the chart must move from v1 to v2 before Langfuse goes to v4. SDK compatibility is a separate check: Python SDK v5 and JS/TS SDK v6 need Langfuse v4.59.0 or later, so upgrade the server before the applications. Use the Langfuse releases page as the reference point, where v4.63.0 was listed as published October 16, 2026, and confirm the current release on the day you plan.

What DeployOpen delivers and what you keep

DeployOpen plans, implements, documents and supports self-hosted platforms inside your own cloud account, and every engagement is fixed-scope with the scope, deliverables and timelines agreed in writing before work starts. The four items below are what that agreement produces and what stays with your team after the work ends.

Scoped Terraform configuration in your repository

The Terraform code for Langfuse lands in a repository you own, built on the official module and pinned to versions you choose. Your team reviews the changes through its normal pull request process. Check that the written scope names which parts of the module are used as published, which are overridden, and which resources sit outside the module, such as existing virtual networks, DNS zones or a shared Key Vault.

Langfuse self-hosting docs

Documented architecture and variable set

You receive a written description of the deployed architecture: the AKS cluster, the Azure Database for PostgreSQL and Blob Storage choices, the ClickHouse and Redis or Valkey layers, network paths and identity assignments. Alongside it sits a catalog of input variables with the value chosen for each and the reason. Ask for the diagram and variable table to be kept current with the code, not as a one-time document.

Verification evidence and runbooks

Verification covers the deployment steps that were run, health checks against the web and worker containers, a test trace sent through the ingestion endpoint, and a restore test for the data stores. Runbooks cover routine tasks such as scaling the worker, rotating secrets and running a Langfuse version update. Confirm in the scope which tests are included and what evidence format you will receive.

Handover of state and access

Terraform state, cloud role assignments, Key Vault secrets and administrator accounts are transferred to your team at handover, so no one outside your organization holds the keys to the stack. Agree in advance where state is stored, who has write access to it, and how break-glass access is recorded. Ongoing operation, upgrades and continuous testing can be contracted separately as a retainer if your team wants that support.

How DeployOpen scopes and supports Langfuse on Azure

DeployOpen starts every Azure build with a written scope that names the pieces the Terraform work will touch: the AKS cluster or the Kubernetes path you choose, the Azure Database for PostgreSQL option, the Blob Storage containers for events, media and exports, the virtual network and private endpoints, the managed identities and Key Vault references, and the ClickHouse and Redis or Valkey layers. The scope also records which parts reuse your existing landing zone, such as hub networking, DNS zones, policy assignments and subscription naming, and which parts the module creates new. Deliverables, acceptance checks and the handover owner are agreed before work starts. Most engagements are fixed-scope, and DeployOpen does not publish a price list, so a quote follows from that written scope.

The build runs inside your subscription, in your tenant, under accounts and pipelines you control. DeployOpen commits the Terraform state to a backend you own, keeps module customizations in your repository, and documents every variable it changes so your platform team can review the diff at the next module release. Where you ask for it, DeployOpen runs security testing against the deployed Langfuse instance and its supporting Azure resources, then prepares compliance-readiness evidence such as configuration records, access reviews and backup test results for your own assessors. DeployOpen prepares that evidence but does not issue audit reports or certifications; independent auditors and certification bodies do. Ask in the quote which evidence items are in scope and who receives them.

Azure deployments change over time, so the scope should also cover life after go-live. DeployOpen offers retainers for Langfuse upgrades, module version bumps, Kubernetes and PostgreSQL maintenance windows and continuous testing, and these are priced separately from the initial build. Ask for a retainer scope that names the Langfuse versions and Terraform module releases it covers, the response expectations for each, and what happens when a major Langfuse upgrade changes the ClickHouse or PostgreSQL requirements. DeployOpen is not an official partner or reseller of Langfuse or Microsoft, so confirm any vendor support entitlement directly with the vendor when it matters to your procurement.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.