From 4c008059dfbd0b2ec7c14e0a6a86ef424102d5bb Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 19 May 2022 13:02:49 -0700 Subject: [PATCH] Add createAzureFunction to extension API (#19438) --- extensions/sql-bindings/src/extension.ts | 3 +++ extensions/sql-bindings/src/sql-bindings.d.ts | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/extensions/sql-bindings/src/extension.ts b/extensions/sql-bindings/src/extension.ts index 4ae8759463..86420ae230 100644 --- a/extensions/sql-bindings/src/extension.ts +++ b/extensions/sql-bindings/src/extension.ts @@ -20,6 +20,9 @@ export async function activate(context: vscode.ExtensionContext): Promise => { return addSqlBinding(bindingType, filePath, functionName, objectName, connectionStringSetting); }, + createAzureFunction: async (): Promise => { + return createAzureFunction(); + }, promptForBindingType: async (funcName?: string): Promise => { return promptForBindingType(funcName); }, diff --git a/extensions/sql-bindings/src/sql-bindings.d.ts b/extensions/sql-bindings/src/sql-bindings.d.ts index 9218fc50b1..f81dbda319 100644 --- a/extensions/sql-bindings/src/sql-bindings.d.ts +++ b/extensions/sql-bindings/src/sql-bindings.d.ts @@ -28,6 +28,11 @@ declare module 'sql-bindings' { */ addSqlBinding(bindingType: BindingType, filePath: string, functionName: string, objectName: string, connectionStringSetting: string): Promise; + /** + * Prompts the user for information to create an Azure Function with SQL Binding + */ + createAzureFunction(): Promise; + /** * Prompts the user to select type of binding and returns result or undefined if the user cancelled out of the prompt * @param funcName (Optional) Name of the function we are adding the SQL Binding to @@ -46,7 +51,7 @@ declare module 'sql-bindings' { /** * Prompts the user to enter connection setting and updates it from AF project * @param projectUri Azure Function project uri - * @param connectionInfo (optional) connection info from the user to update the connection string, + * @param connectionInfo (optional) connection info from the user to update the connection string, * if left undefined we prompt the user for the connection info * @returns connection string setting name to be used for the createFunction API */