Skip to content

Fix spurious "Select a resource group" step in Azure SQL connection wizard#5006

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-extra-select-resource-group-step
Draft

Fix spurious "Select a resource group" step in Azure SQL connection wizard#5006
Copilot wants to merge 3 commits intomainfrom
copilot/fix-extra-select-resource-group-step

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

  • Remove ResourceGroupListStep from SqlConnectionListStep.getSubWizard() (it was dead UX since server listing is subscription-wide)
  • Move ResourceGroupListStep to SqlServerListStep.getSubWizard() - only add it when creating a NEW SQL server (!context.sqlServer)
  • After selecting an existing SQL server in SqlServerListStep.prompt(), extract and assign both the resource group name and location to context.resourceGroup from the server's resource ID and location property (only if not already set)
  • Build fix: ResourceGroup type requires location - now populated from context.sqlServer.location

- Remove ResourceGroupListStep from SqlConnectionListStep.getSubWizard() - it was dead UX since SqlServerListStep lists servers subscription-wide and ignores the selected resource group
- Move ResourceGroupListStep to SqlServerListStep.getSubWizard() so it only appears when creating a NEW SQL server (where it is actually needed by SqlServerCreateStep)
- After selecting an existing SQL server in SqlServerListStep.prompt(), extract and assign the resource group name to context.resourceGroup from the server's resource ID (only if not already set)

Agent-Logs-Url: https://github.com/microsoft/vscode-azurefunctions/sessions/fd595c8e-96ce-4e32-bcdd-17ba6418b11d

Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 6, 2026 18:24
Copilot AI changed the title [WIP] Fix extra 'Select a resource group' step during Azure SQL connection Fix spurious "Select a resource group" step in Azure SQL connection wizard May 6, 2026
Copilot AI requested a review from nturinski May 6, 2026 18:25
@nturinski
Copy link
Copy Markdown
Member

@copilot Fix the build. You should get the location from the sql resource as well.

…up context

ResourceGroup type requires location property. Populate it from the
selected server's location, which also satisfies the comment to get
the location from the SQL resource.

Agent-Logs-Url: https://github.com/microsoft/vscode-azurefunctions/sessions/b28bc730-2bf0-4c4b-b3a3-1e0ed5c98934

Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 6, 2026 22:12
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 6, 2026

@copilot Fix the build. You should get the location from the sql resource as well.

Fixed in 152b0a8. The ResourceGroup type requires a location property — now set from context.sqlServer.location alongside the resource group name extracted from the server's resource ID.


if (context.sqlServer && !context.resourceGroup) {
const rgName: string = getResourceGroupFromId(nonNullProp(context.sqlServer, 'id'));
context.resourceGroup = { name: rgName, location: nonNullProp(context.sqlServer, 'location') };
Copy link
Copy Markdown
Contributor

@MicroFish91 MicroFish91 May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might it be worth pulling the actual resource and setting it here? I think that would be safer in case we ever nonNull one of the other resource properties somewhere else in the step chain as many of the "optional" properties are usually provided by the service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extra "Select a resource group" step displays when connecting Azure SQL during MSSQL Durable project debug

3 participants