Report this

What is the reason for this report?

Mongo CRT file location with Apps service

Posted on June 30, 2022

How do I specify the crt file location on App platform for my Mongodb connection string? I can’t use environmental variables as the Mongodb connection string needs a file.

I don’t want to build into my docker image for security reasons. What is the best solution please?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

One way to achieve this would be to create the CA certificate file in your app’s code directly right before initializing the MongoDB connection.

For example, if you are using NodeJS, it would look something like this:

fs.writeFileSync(path.resolve(__dirname, "mongodb.ca.crt"), process.env.CA_CERT)

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.