- Edited
Hello,
I'm running the latest osTickets 1.6.1 in an Azure App Service container utilising automatic deployment from a private git repo (Azure DevOps). Everything works great but I'm hoping to avoid using hard coded setting in the ost-config.php file and pass the configuration values as environmental variables to the container from Azure. Here is the section of ost-config.php that I tried to modify. Unfortunately it did not worked. I'm wondering if somebody has a better (working solution) for this:
## Define array for environmental variables
# ---------------------------------------------------
$envvars = array (
'ost_mysql_dbhost' => getenv (OST_MYSQL_DBHOST),
'ost_mysql_dbname' => getenv (OST_MYSQL_DBNAME),
'ost_mysql_dbuser' => getenv (OST_MYSQL_DBUSER),
'ost_mysql_dbpass' => getenv (OST_MYSQL_DBPASS),
'ost_admin_email' => getenv (OST_ADMIN_EMAIL) ,
'ost_table_prefix' => getenv (OST_TABLE_PREFIX)
);
# Encrypt/Decrypt secret key - randomly generated during installation.
define('SECRET_SALT','%CONFIG-SIRI');
#Default admin email. Used only on db connection issues and related alerts.
define('ADMIN_EMAIL',$envvars['ost_admin_email']);
# Database Options
# ---------------------------------------------------
# Mysql Login info
define('DBTYPE','mysql');
define('DBHOST',$envvars['ost_mysql_dbhost']);
define('DBNAME',$envvars['ost_mysql_dbname']);
define('DBUSER',$envvars['ost_mysql_dbuser']);
define('DBPASS',$envvars['ost_mysql_dbpass']);
# Table prefix
define('TABLE_PREFIX',$envvars['ost_table_prefix']);