sameer

sameer

Deploying & Managing an Elixir application on Azure Container Apps

Hi folks,
I have currently setup a POC of running an elixir application on Azure Container Apps (ACA) and it works. We currently need to run on Azure and ACA seems to provide the right set of abstractions (runs containers but abstracts away Kubernetes) to run applications with the least amount of operational overhead.

Thinking beyond POC & about Day 2 operations, I am wondering

  • Is anyone else using ACA + Elixir in Production ?
  • Any gotchas to be aware of ?
  • Are you running a clustered setup on ACA or is it feasible to do so ?

Thanks
Sameer

Most Liked

chgeuer

chgeuer

If you plan to run the BEAM using Erlang distribution, I don’t think Azure Container Apps is the ideal environment for that. If all BEAM instances are standalone (behind the load balancer / ingress), then all is good. But Erlang distribution is east-west-traffic, cluster-internal gossip. For that to work, you need 2 things:

  1. You want to be able to discover the IP addresses of other BEAM instances/nodes/pods.
  2. You must be able to actually get the TCP traffic going across these nodes.

Discovery: I’m not aware of an API that a freshly booted node could query, to enumerate the environment. It seems not to be exposed in ARM, also not in an environment variable. As a workaround, a fresh node could write it’s own IP to an external configuration store (Azure Storage, relational DB, etcd/consul/zookeeper), and use that store to discover other nodes. But that complicates things, because now you also depend on that external component.

East/West traffic: Assuming you found all the VNET-internal IP addresses of the other nodes, you need to establish the TCP connection when your instance connects to another node. Azure Container Apps has effectively an AKS cluster under the hood, and it has a certain CNI implementation going. Assuming you can successfully get your app to fly, but in 6 months down the road the Container apps team changes the CNI implementation and suddenly you can no longer directly talk across nodes, that would be an outage outside of your sphere of influence.

I guess that’s a long-winded explanation to say: If you want Erlang distribution, certainly running on Azure Kubernetes Service (AKS) or on IaaS virtual machines might be the most predictable option.

It might be that there’s some other way, but I’m not aware of.

superchris

superchris

We’ve been running an Elixir system (phoenix liveview app) in production on Azure for a few years, but not using Azure Container services. We started with terraform but moved to bicep later for our infrastructure as code. Happy to sync up and share experience if it is helpful. PM me.

sameer

sameer

Thank you for looking into it further @chgeuer and for providing a definitive answer.

Where Next?

Popular in Questions Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement