rosshamish / kuskus

The extension pack so nice they named it twice
https://marketplace.visualstudio.com/items?itemName=rosshamish.kuskus-extensions-pack
44 stars 10 forks source link

Allow connecting to cluster using settings and environment variables #67

Open assafmendelson opened 2 years ago

assafmendelson commented 2 years ago

Currently, when I want to connect to a cluster I need to load it which means manually entering the cluster URL, authority id and database. Then we go to the microsoft login page.

Instead it would be useful if I could define in the settings some database and allow to extract their credentials from environment variables. For example in the settings I would have something like:

"databases": [{ "database_id": "db1" "database": "my_database1" "cluster": "https://my_cluster.kusto.windows.net", "authority_id": "${authority_id_env_var_for_cluster1}", "client_id": "${client_id_env_var_for_cluster1}", "client_secret": "${client_secret_env_var_for_cluster1}", },{...}]

Then I would be able to give a command: load db1 and the connection would be configured where it gets the credentials from environment variables.

rosshamish commented 2 years ago

This sounds like a great idea. Maybe you could optionally declare one as the default too.

My only concern is to be sure that no secrets are stored in plaintext in the extension settings.

Are you interested in taking a swing at this? I'd be happy to take a contribution and provide some help as you go.