What is the best way to deploy NATS using Azure

192 views Asked by At

I have Multiple apps that are connected to NATS and need a NATS instance deployed on Azure.

So far I have tried to deploy to the app service and it didn't work as expected because of the PORTs available in the app service.

Dockerfile:

FROM nats:latest
EXPOSE 4222 6222 8222

I have tried to upload the docker to ACR and then created a container instance using the docker image in ACR. The NATS is running and able to connect using the NATS library.

const NATS = require('nats');
NATS.connect(
    { 
        servers: NATS_RL,
        debug: true
    }
)

But the issue is when multiple apps are connected and when an app sends a message to a topic it is not listened to on other apps. on localhost, everything is working fine.

Anyone who knows how to set up a NATS docker locally and in Azure which is fully configured.

0

There are 0 answers