import * as vscode from 'vscode' ; import { IActionContext } from 'vscode-azureextensionui' ; import { ServiceTreeItem } from '../explorer/ServiceTreeItem' ; import { ext } from '../extensionVariables' ; export async function copySubscriptionKey ( context , node ? ) { if ( ! node ) { node = < ServiceTreeItem > await ext . tree . showTreeItemPicker ( ServiceTreeItem . contextValue , context ) ; } const key = await node . copySubscriptionKey ( ) ; vscode . env . clipboard . writeText ( key ) ; }