1

I´m trying to get some docker images running on Azure. To be concrete, I have a Redis service, a MongoDB server (not CosmosDB) from bitnami and the coralproject talk. In order to start the docker container locally, I have to set some environment variables like

docker run -e key1=value1 -e key2=value2 -p 80:3000 ...

Now, I am trying to get the app running in Azure. Searching for how to start docker container in Azure, I found several options:

  1. Container Instances
  2. App Services
  3. Virtual Machine
  4. Managed Kubernetes (Preview state)
  5. Container Services (somehow deprecated, will be replaced by Managed Kubernetes in the future)

Running a VM for one docker instance doesn´t sound economical. A Managed Kubernetes or Container Service is maybe a bit too much for now, whereby I can not select any version even with "Managed Kubernetes". I guess this is related to the current Preview state. I also tried App Services, but without success, e.g. no proper settings for environment variables. I saw that in App Services you can set a Start File, but without explanations from Microsoft. What should this be, a Start File? So I tried number one, Container Instances.

Unfortunately I can not find a way how to pass multiple environment variables at the time of starting the container. At the setup wizard you can set one environment variable and another two if you like to:

enter image description here

First, it is limited to three environment parameters. I need more. Second, the value needs to be alphanumeric, setting a domain is not possible.

Does anyone here has some experience in running docker instances on Azure? What is the best setup for you?

Thanks in advance.

smichel
  • 745
  • 1
  • 7
  • 14
  • Can you not set your environment variables in your docker image? I haven't had too much experience with single-container app services before, mostly aks, acs, and vm's. Just trying to get a sense of what you need them set in the actual instance for – C.Nivs May 07 '18 at 20:40
  • This could be, but maybe some of them needs to be set during startup. Imagine you have an environment variable or a connection string to you database. You don´t want to have different images for staging and for production environment. – smichel May 08 '18 at 06:15
  • 1
    Using the Azure CLI works as a workaround: `az container create --resource-group --name --dns-name-label --image -e a='a' b='https://www.google.com' c='https://stackovervlow.com' ...` – smichel May 17 '18 at 14:16
  • Possible duplicate of [Deploy Azure Webapp with custom container environment variables](https://stackoverflow.com/questions/50681821/deploy-azure-webapp-with-custom-container-environment-variables) – Kangur Nov 23 '18 at 15:50

0 Answers0