You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working with a polyglot notebook, it’s necessary to avoid displaying the SQL database connection string.
Directly storing it in a variable reveals it in the variable list. How can this string be safely concealed?
Additionally, can the same approach be used to protect other sensitive secrets as well?
#!meta
{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"languageName":"csharp","name":"csharp"},{"aliases":[],"languageName":"T-SQL","name":"sql-Integration_MyCompany"}]}}
#!markdown
## Load environment variables
#!markdown
More info about **dotnet-interactive** can be found [here](https://github.com/dotnet/interactive/blob/main/docs/FAQ.md)
#!csharp
// #r "nuget: DotNetEnv,*-*"
// DotNetEnv.Env.Load();
// System.Environment.GetEnvironmentVariable("message_from_env_file").Display();
#!markdown
## Load SQL Library
#!csharp
#r "nuget:Microsoft.DotNet.Interactive.SqlServer,*-*"
var connectionString = System.Environment.GetEnvironmentVariable("integration_smartpocure_sql");
#!csharp
#!connect mssql --kernel-name Integration_MyCompany --connection-string @connectionString
#!markdown
### All records
#!markdown
#!sql-Integration_MyCompany
select * from dbo.states
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While working with a polyglot notebook, it’s necessary to avoid displaying the SQL database connection string.
Directly storing it in a variable reveals it in the variable list. How can this string be safely concealed?
Additionally, can the same approach be used to protect other sensitive secrets as well?
Beta Was this translation helpful? Give feedback.
All reactions