@@ -32,7 +32,6 @@ import { QueryHistoryProvider } from '../queryHistory/queryHistoryProvider';
32
32
import { QueryHistoryNode } from '../queryHistory/queryHistoryNode' ;
33
33
import { DacFxService } from '../services/dacFxService' ;
34
34
import { IConnectionInfo } from 'vscode-mssql' ;
35
- import { getConnectionString } from '../utils/connectionStringUtil' ;
36
35
import { SchemaCompareService } from '../services/schemaCompareService' ;
37
36
import { SqlTasksService } from '../services/sqlTasksService' ;
38
37
import { AzureFunctionsService } from '../services/azureFunctionsService' ;
@@ -443,14 +442,9 @@ export default class MainController implements vscode.Disposable {
443
442
444
443
// Generate Azure Function command
445
444
this . _context . subscriptions . push ( vscode . commands . registerCommand ( Constants . cmdCreateAzureFunction , async ( node : TreeNodeInfo ) => {
446
- const database = ObjectExplorerUtils . getDatabaseName ( node ) ;
447
- const connStr = getConnectionString (
448
- node . connectionInfo . server ,
449
- node . connectionInfo . authenticationType ,
450
- database ,
451
- node . connectionInfo . user ,
452
- node . connectionInfo . password ) ;
453
- await this . azureFunctionsService . createAzureFunction ( connStr , node . metadata . schema , node . metadata . name ) ;
445
+ const connectionUri = this . _connectionMgr . getUriForConnection ( node . connectionInfo ) ;
446
+ const connectionString = await this . _connectionMgr . getConnectionString ( connectionUri ) ;
447
+ await this . azureFunctionsService . createAzureFunction ( connectionString , node . metadata . schema , node . metadata . name ) ;
454
448
} ) ) ;
455
449
}
456
450
0 commit comments