Drush can not connect to mysql when run a Drupal in a Docker/Azure I have a website that it's running ok in Docker/Azure.

I have this configuration in my settings.php

$databases ['default'] ['default'] = array (
    'database' =&gt; getenv ( 'MYSQL_DATABASE' ),
    'username' =&gt; getenv ( 'MYSQL_USER' ),
    'password' =&gt; getenv ( 'MYSQL_PASSWORD' ),
    'prefix' =&gt; '',
    'host' =&gt; getenv ( 'MYSQL_HOSTNAME' ),
    'port' =&gt; getenv ( 'MYSQL_PORT' ),
    'driver' =&gt; 'mysql'
);


When I make drush status

I get this.

 Drupal version   : 8.7.3                                      
 Site URI         : http://default                             
 DB driver        :                                       
 DB hostname      :                                      
 DB port          :                                        
 DB username      :                                 
 DB name          : 


Any idea how to make that Drush get the mysql configuration options?

Thanks
It looks like the environment variables are defined only for HTTP requests. In other words, they seem to be set in FPM, NGINX, or Apache, but not in your shell.

Try typing echo $MYSQL_DATABASE in your shell. If that outputs nothing, you'll have to export the environment variables first, so Drush can see them.