TabularEditor / TabularEditor

This is the code repository and issue tracker for Tabular Editor 2.X (free, open-source version). This repository is being maintained by Daniel Otykier.
https://tabulareditor.com
MIT License
849 stars 205 forks source link

Omit password from connection string details when releasing from CLI #1209

Closed gabrielsmelchor closed 1 week ago

gabrielsmelchor commented 2 weeks ago

!!! For Tabular Editor 3 questions, go here --> https://github.com/TabularEditor/TabularEditor3/issues !!!

What are you trying to achieve? I'm releasing a model through the CLI in Azure Devops. I first open the model from a workspace and then release to target workspaces. When opening the model from the workspace, I receive an output that contains the password in the connection string. This causes Azure DevOps to encrypt the logs, making them unusable.

Here's what my output looks like:

Loading model from server Provider=MSOLAP;Data Source=<serverConnectionString>;User ID=<userName>;Password=<password>...

Here's what my deploy model step looks like in Powershell:

# deploy Dataset
function DeployDataset {
    param(
        [string]$workspaceName,
        [string]$stagingWorkspaceName,
        [string]$pbi_username,
        [string]$pbi_pass_string,
        [string]$dsname
    )
   $buildDirectory = $env:build_definition
    [System.Environment]::SetEnvironmentVariable("SQLServerName", "$sqlserver")
    [System.Environment]::SetEnvironmentVariable("SQLDatabaseName", "$sqldb")
    $sourceServer = "Provider=MSOLAP;Data Source=powerbi://api.powerbi.com/v1.0/myorg/$($stagingWorkspaceName);User ID=$($pbi_username);Password=$($pbi_pass_string)"
    $releaseServer = "Provider=MSOLAP;Data Source=powerbi://api.powerbi.com/v1.0/myorg/$($workspaceName);User ID=$($pbi_username);Password=$($pbi_pass_string)"    

try {
        $p = Start-Process `
            -Wait -NoNewWindow -PassThru `
            -FilePath  "TabularEditor.exe" `
            -ArgumentList "`"$($sourceServer)`" `"$($dsname)`" -S `"$buildDirectory\scripts\c#\SetExpressionString.cs`" -D `"$($releaseServer)`" `"$($dsname)`" -O -C -P -V" `            
            -RedirectStandardOutput ".\log.txt"        
        return $p.ExitCode        
    }
    catch { $p.ExitCode }
}

What have you tried so far? I've tried setting the password in the server connection string as a logging command, but the logs are still encrypted in Azure Devops.

otykier commented 1 week ago

Thanks for reporting - this is now fixed in 2.25.0.