mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 01:25:38 -05:00
Adds SQL Binding Create Azure Function with SQL Binding tests (#19538)
* add a couple of azure function service tests * address comments * use mock for azureFunctionExtensionAPI
This commit is contained in:
@@ -63,7 +63,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
||||
|
||||
isCreateNewProject = true;
|
||||
telemetryStep = CreateAzureFunctionStep.getSelectedFolder;
|
||||
// user either has not folder open or an empty workspace
|
||||
// user either has no folder open or an empty workspace
|
||||
// prompt user to choose a folder to create the project in
|
||||
const browseProjectLocation = await vscode.window.showQuickPick(
|
||||
[constants.browseEllipsisWithIcon],
|
||||
@@ -190,6 +190,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
||||
// prompt for Connection String Setting Name
|
||||
let connectionStringInfo: IConnectionStringInfo | undefined = { connectionStringSettingName: constants.sqlConnectionStringSetting, connectionInfo: connectionInfo };
|
||||
if (!isCreateNewProject && projectFile) {
|
||||
// if it is not a new project, we can prompt user for connection string setting name and connection string password prompts
|
||||
telemetryStep = CreateAzureFunctionStep.getConnectionStringSettingName;
|
||||
connectionStringInfo = await azureFunctionsUtils.promptAndUpdateConnectionStringSetting(vscode.Uri.parse(projectFile), connectionInfo);
|
||||
if (!connectionStringInfo) {
|
||||
@@ -227,7 +228,6 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
||||
// check for the new function file to be created and dispose of the file system watcher
|
||||
const timeoutForFunctionFile = utils.timeoutPromise(constants.timeoutAzureFunctionFileError);
|
||||
await Promise.race([newFunctionFileObject.filePromise, timeoutForFunctionFile]);
|
||||
|
||||
telemetryStep = 'finishCreateFunction';
|
||||
propertyBag.telemetryStep = telemetryStep;
|
||||
exitReason = ExitReason.finishCreate;
|
||||
@@ -254,9 +254,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
||||
propertyBag.exitReason = exitReason;
|
||||
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.exitCreateAzureFunctionQuickpick)
|
||||
.withAdditionalProperties(propertyBag).send();
|
||||
if (newFunctionFileObject) {
|
||||
newFunctionFileObject.watcherDisposable.dispose();
|
||||
}
|
||||
newFunctionFileObject?.watcherDisposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user