You built a Java app on Tomcat years ago, and it still does the job. Then someone mentioned Azure Functions and how “you could just serverless that.” You smiled politely and thought, Sure, if you enjoy reinventing the wheel with YAML. But good news: Azure Functions and Tomcat can actually play nice, and you do not need to lose your logs or your sanity.
At its core, Azure Functions is an event‑driven compute platform that runs small units of code on demand. Tomcat is the dependable Java servlet container that has powered web apps since dinosaurs roamed data centers. Together, they let Java workloads scale elastically without dragging along a full VM, letting you keep existing APIs while modernizing the operational model.
Here is where most teams trip. They try to “migrate” their Tomcat app, but what works better is to decouple specific endpoints into Azure Functions that call into Tomcat services running on a slim container or App Service. Triggers in Azure (HTTP, Queue, or Event Hub) handle the orchestration, while your Tomcat instance focuses on the parts that truly need Java web semantics.
Integration workflow:
Use authentication middleware inside Azure Functions to validate identities via OIDC or OAuth2 (Okta, Entra ID, or another IdP). Functions then invoke Tomcat endpoints using managed identities that never expose secrets. Logging flows back into Application Insights, so you see both function‑level latency and Tomcat servlet performance in one dashboard. The result looks less like a migration and more like a power‑move: Tomcat serving business logic, Azure eating the operational grunt work.
Best practices for stable integration:
Keep Tomcat stateless by moving session data to Azure Cache for Redis. Rotate Tomcat credentials through Azure Key Vault. If you must pass environment variables, use Function App settings, not config files. Trace correlation IDs across both runtimes so debugging feels less like hunting ghosts.