import { AzureParentTreeItem , AzureTreeItem , IActionContext , SubscriptionTreeItemBase } from 'vscode-azureextensionui' ; import { ext } from '../extensionVariables' ; import { treeUtils } from '../utils/treeUtils' ; export async function createService ( context , subscription ? , _resourceGroup ? ) { let node ; if ( typeof subscription === 'string' ) { node = await treeUtils . getSubscriptionNode ( ext . tree , subscription ) ; } else if ( ! subscription ) { node = < AzureParentTreeItem > await ext . tree . showTreeItemPicker ( SubscriptionTreeItemBase . contextValue , context ) ; } else { node = subscription ; } const serviceNode = await node . createChild ( context ) ; return serviceNode . fullId ; }