-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Create Azure Function with SQL Binding more efficient and simple #19187
Conversation
Pull Request Test Coverage Report for Build 2228888338
💛 - Coveralls |
Follow up PR will cover this issue #19203 |
// Ask binding type for promptObjectName | ||
quickPickStep = 'getBindingType'; | ||
let selectedBinding = await azureFunctionsUtils.promptForBindingType(); | ||
telemetryStep = CreateAzureFunctionStep.getConnectionString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need telemetryStep? It seems that you are reassigning it's value without sending it as telemetry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So currently I have this so that if an error occurs at any point or if the user cancels a certain step within the flow then in the finally block we would send where they left off from.
// prompt user for include password for connection string | ||
if (isCreateNewProject) { | ||
if (isCreateNewProject && functionFilePath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to make sure the azure function project is created prior to adding the connection string to the local.settings.json for the folder the user selected (and added to the workspace).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't spend a ton of time going through all the logic - way too many changes to be able to fully review this. Make sure you're spending lots of time testing this yourself and setting up bug bashes as needed.
@@ -575,3 +575,21 @@ export async function promptConnectionStringPasswordAndUpdateConnectionString(co | |||
return undefined; | |||
} | |||
} | |||
|
|||
export async function getDatabase(connectionInfo: IConnectionInfo): Promise<string | undefined> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
promptSelectDatabase
- it's not clear what "get" means in this case
try { | ||
const azureFunctionApi = await azureFunctionsUtils.getAzureFunctionsExtensionApi(); | ||
if (!azureFunctionApi) { | ||
propertyBag.exitReason = exitReason; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be "error" at this point
if (projectCreate === constants.learnMore) { | ||
telemetryStep = CreateAzureFunctionStep.learnMore; | ||
void vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(constants.sqlBindingsDoc)); | ||
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to send this event? Couldn't you just use the exit event and check for step == learnMore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's right. We could also use the final block to see if it exited with the step learnMore.
This PR simplifies our process to Create Azure Function with SQL Binding.
Three Scenarios were covered:
Flow is found here
Issues fixed:
General Flow of Logic: