From f2b638a5ed7a949124e29e5a2352bcb073d61456 Mon Sep 17 00:00:00 2001 From: Ryan Thorn <106628688+rthorn-nr@users.noreply.github.com> Date: Wed, 31 May 2023 13:34:10 -0700 Subject: [PATCH] fix(mssql): Fix sqlcmd credential override (#930) --- recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml b/recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml index d24badc8a..51e347905 100644 --- a/recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml +++ b/recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml @@ -265,12 +265,12 @@ install: if (Test-Path $NriSqlFile) { Remove-Item $NriSqlFile } Add-Content -Path $NriSqlFile -Value $SQL -Force 2>&1 # Try with env if passed in - if ($NR_SQL_USERNAME -and $NR_SQL_PASSWORD) { + if ($NEW_RELIC_MSSQL_SQL_USERNAME -and $NEW_RELIC_MSSQL_SQL_PASSWORD) { Write-Host "sqlcmd with credentials" - $SqlOutput=(sqlcmd -U $NR_SQL_USERNAME -P $NR_SQL_PASSWORD -S $connection -i $NriSqlFile 2>&1) + $SqlOutput=(sqlcmd -U $NEW_RELIC_MSSQL_SQL_USERNAME -P $NEW_RELIC_MSSQL_SQL_PASSWORD -S $connection -i $NriSqlFile 2>&1) } # Env failed or blank, try with default - if ([string]::IsNullOrWhiteSpace($NR_SQL_USERNAME) -or ($SqlOutput.Length -lt 3)){ + if ([string]::IsNullOrWhiteSpace($NEW_RELIC_MSSQL_SQL_USERNAME) -or ($SqlOutput.Length -lt 3)){ Write-Host "sqlcmd with no credentials" $SqlOutput=(sqlcmd -S $connection -i $NriSqlFile 2>&1) }