Cannot set use environment.yml to set environment variables with underscores in the name

This page in the Conda documentation provides a sample environment.yml as follows:

name: env-name
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - codecov
variables:
  VAR1: valueA
  VAR2: valueB

If I save this as environment.yml, run conda env create -f environment.yml, then conda activate env-name, you can verify that the environment variables VAR1 and VAR2 are set correctly. However, with the following modification, only VAR1 is set:

name: env-name
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - codecov
variables:
  VAR1: valueA
  VAR_WITH_UNDERSCORES: valueB

VAR_WITH_UNDERSCORES remains empty. I have tested this on Windows 10 (latest patch) and openSUSE Tumbleweed in WSL2. Quoting the variable name has no effect. I use the latest version of Miniconda, with conda --version outputting conda 24.7.1.

Is there a workaround for this apparent bug?

Can anyone else attest to this bug? It is very easy to reproduce and breaks a core piece of functionality.