EnvironmentVariables and/or secrets


How do I securely configure a service with secrets such as API-keys?
I rather not add those to the container-image.
For example, having a environment-variable ‘API_KEY’ which contains a secrent, and in application.properties:


Maybe I’m overlooking it, but I don’t find any documentation on it.


You can use environment variables today. This can be setup both through console and the CLI. I couldn’t find a specific example in the docs, on how to use, but then again, I think that it ends up being straightforward. Perhaps @retgits has a simple example?

We are exploring the use of a separate store for externalized credential and that is a roadmap item.

Hi @thomashoutekier-reaktika,

As @jeremy.pollock mentioned you could do it using either the CLI or the UI. From the CLI you can add the --env flag that takes a comma separated list of environment variables. To use the API_KEY variable from your question it would be:

akkasls services deploy my-service my-repo/my-service-image --env API_KEY=1234,OTHER_VAR="something including spaces"

From the Akka Serverless Console you set them during the deployment of your service too (it’s step 3 in the deployment wizard)

Let me know if you have any questions!

1 Like