0

I am deploying elasticsearch container instance but when I am adding the environment variable "node.name" I am getting the below error

The environment variable name in container 'dev-elasticsearch' of container group 'devt-elasticsearch' is invalid. A valid environment variable name must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_' (e.g. 'my_name',  or 'MY_NAME',  or 'MyName'). 

here is the snippet of yml file

api-version: 2018-10-01
location: japaneast
name: dev-elasticsearch
properties:
  containers:
    - name: dev-elasticsearch
      properties:
        environmentVariables:
          - name: 'node.name'
            value: es-dev
          - name: ES_JAVA_OPTS
            value: "-Xms512m -Xmx512m"
so9868
  • 105
  • 10

3 Answers3

0

Try without quotes for the value,

 - name: ES_JAVA_OPTS
   value: -Xms512m -Xmx512m
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
0

Just like the error shows, your variable name node.name is invalid. It doesn't match the naming rules of the Azure Container group. You can change the variable name like this:

properties:
  environmentVariables:
    - name: node_name
      value: es-dev
Charles Xu
  • 29,862
  • 2
  • 22
  • 39
0

As another workaround you could build a custom Docker image as such:

FROM elasticsearch:7.8.1

ENV name=node.name

You'll then have to host it with ACR, Dockerhub or similar