We want to add "Open in VS Code" buttons to the Azure Portal and Fabric, for this we need to implement a handler using vscode.window.registerUriHandler (on activation) which will open the selected database/container in the Query Editor.
Ideally we would detect whether the resource exists in the Azure Resources tree and navigate to there, however that's currently not supported by the Tree View API.
The simplest approach (per offline discussion) is to support following Uri parameters:
- connection string (can support any database type)
- we should be able to detect which database SDK it is (NoSQL/Mongo) and act accordingly
- Database Name
- Container Name
Following actions would be taken:
- Look up if an Attached Account with the same connection string exists
- Add an "Attached Account" entry if not
- Expand the node
- Open the Query editor for the given database and collection