import { window } from 'vscode' ; import { globalState } from '../globalState' ; export interface AzureMetadata { resourceGroup : string ; resourceName : string ; subscriptionId : string ; } param contextName export async function askUserForAzureMetadata ( contextName ) { const azureMetadata = globalState . getClusterMetadata ( contextName ) ; const resourceGroup = await window . showInputBox ( { title : 'Enter the Azure Resource Group (where the cluster is)' , ignoreFocusOut : true , value : azureMetadata ?. azureResourceGroup ?? '' , } ) ; if ( ! resourceGroup ) { return ; } const resourceName = await window . showInputBox ( { title : 'Enter the Resource Name' , ignoreFocusOut : true , value : azureMetadata ?. azureClusterName ?? '' , } ) ; if ( ! resourceName ) { return ; } const subscriptionId = await window . showInputBox ( { title : 'Enter ID of Azure subscription that owns the resource group' , ignoreFocusOut : true , value : azureMetadata ?. azureSubscription ?? '' , } ) ; if ( ! subscriptionId ) { return ; } globalState . setClusterMetadata ( contextName , { azureResourceGroup : resourceGroup , azureSubscription : subscriptionId , azureClusterName : resourceName , } ) ; return { resourceGroup , subscriptionId , resourceName , } ; }