Skip to content

Commit f2b638a

Browse files
authored
fix(mssql): Fix sqlcmd credential override (#930)
1 parent 2f07ff4 commit f2b638a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ install:
265265
if (Test-Path $NriSqlFile) { Remove-Item $NriSqlFile }
266266
Add-Content -Path $NriSqlFile -Value $SQL -Force 2>&1
267267
# Try with env if passed in
268-
if ($NR_SQL_USERNAME -and $NR_SQL_PASSWORD) {
268+
if ($NEW_RELIC_MSSQL_SQL_USERNAME -and $NEW_RELIC_MSSQL_SQL_PASSWORD) {
269269
Write-Host "sqlcmd with credentials"
270-
$SqlOutput=(sqlcmd -U $NR_SQL_USERNAME -P $NR_SQL_PASSWORD -S $connection -i $NriSqlFile 2>&1)
270+
$SqlOutput=(sqlcmd -U $NEW_RELIC_MSSQL_SQL_USERNAME -P $NEW_RELIC_MSSQL_SQL_PASSWORD -S $connection -i $NriSqlFile 2>&1)
271271
}
272272
# Env failed or blank, try with default
273-
if ([string]::IsNullOrWhiteSpace($NR_SQL_USERNAME) -or ($SqlOutput.Length -lt 3)){
273+
if ([string]::IsNullOrWhiteSpace($NEW_RELIC_MSSQL_SQL_USERNAME) -or ($SqlOutput.Length -lt 3)){
274274
Write-Host "sqlcmd with no credentials"
275275
$SqlOutput=(sqlcmd -S $connection -i $NriSqlFile 2>&1)
276276
}

0 commit comments

Comments
 (0)