Skip to content

Added Azure provisioning#22105

Open
laurenastrid1 wants to merge 22 commits into
mainfrom
laurenastrid1/azureProvisioning
Open

Added Azure provisioning#22105
laurenastrid1 wants to merge 22 commits into
mainfrom
laurenastrid1/azureProvisioning

Conversation

@laurenastrid1
Copy link
Copy Markdown
Contributor

Description

azureprovisioningdemo

Added azure provisioning feature

Todo:

  • update icons and links
  • tests

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Copilot AI review requested due to automatic review settings May 12, 2026 22:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an Azure SQL Database provisioning flow to the Deployment webview, including a new deployment type, wizard pages (info/form/provisioning), supporting reducers/state, and Azure ARM helper methods to create resource groups, servers, and databases.

Changes:

  • Adds a new Azure SQL Database deployment type to the Deployment webview UI (selector card + wizard pages + advanced options/tags).
  • Introduces Azure SQL-specific shared state/reducers and backend deployment helpers to load Azure “cascading” components and perform provisioning + connection.
  • Extends Azure helper utilities to support resource groups, locations, SQL server creation, database creation, and maintenance configurations; adds dependencies needed for public IP + maintenance.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
localization/xliff/vscode-mssql.xlf Adds localization entries for the new Azure SQL Database provisioning UI (ignored for detailed review per guidelines).
extensions/mssql/src/webviews/pages/Deployment/deploymentStateProvider.tsx Adds RPC actions for Azure SQL Database deployment flow and memoizes formAction.
extensions/mssql/src/webviews/pages/Deployment/deploymentStartPage.tsx Routes into the Azure SQL Database wizard once its state is loaded/ready.
extensions/mssql/src/webviews/pages/Deployment/deploymentSelector.ts Adds an Azure SQL Database-specific selector hook.
extensions/mssql/src/webviews/pages/Deployment/chooseDeploymentTypePage.tsx Adds the Azure SQL Database deployment type card to the chooser UI.
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/docsLinkCard.tsx New reusable card component to show “what’s next” documentation links.
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/createServerDrawer.tsx New drawer UI to create an Azure SQL logical server (location + auth + credentials).
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/createResourceGroupDrawer.tsx New drawer UI to create a resource group with location selection.
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/azureSqlDatabaseProvisioningPage.tsx New provisioning status page (deployment + connection progress + docs links).
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/azureSqlDatabaseInfoPage.tsx New intro/info page describing Azure SQL DB and linking to docs.
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/azureSqlDatabaseFormPage.tsx New form page with cascading Azure selectors, auth fields, free-tier behavior, and advanced options drawer.
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/azureSqlDatabaseDeploymentWizard.tsx New wizard wiring pages together and triggering provisioning via reducers.
extensions/mssql/src/webviews/pages/Deployment/AzureSqlDatabase/advancedOptionsDrawer.tsx New advanced options drawer (maintenance, firewall info, tags).
extensions/mssql/src/webviews/common/locConstants.ts Adds webview localization bundle for Azure SQL Database provisioning strings.
extensions/mssql/src/webviews/common/icons/azureSqlDatabase.tsx Adds an Azure SQL Database icon used in deployment chooser/wizard.
extensions/mssql/src/webviews/common/forms/form.component.tsx Tweaks label decoration spacing (columnGap -> gap).
extensions/mssql/src/sharedInterfaces/telemetry.ts Adds telemetry view/actions for Azure SQL Database deployment operations.
extensions/mssql/src/sharedInterfaces/form.ts Expands FormEvent.value to allow numbers (needed for autoPauseDelay).
extensions/mssql/src/sharedInterfaces/deployment.ts Extends deployment state/context/reducers to include Azure SQL Database types.
extensions/mssql/src/sharedInterfaces/azureSqlDatabase.ts Adds new shared interfaces/state/reducers/constants for Azure SQL Database deployment.
extensions/mssql/src/deployment/deploymentWebviewController.ts Integrates Azure SQL Database state init, reducer registration, cascading resets, and close telemetry.
extensions/mssql/src/deployment/azureSqlDatabaseHelpers.ts New backend helper: loads Azure components, provisions DB, creates firewall rule, connects, and emits telemetry.
extensions/mssql/src/constants/locConstants.ts Adds backend localization strings for Azure SQL Database helper flows.
extensions/mssql/src/connectionconfig/azureHelpers.ts Adds ARM helpers for resource groups, locations, SQL servers, DB creation, and maintenance configs.
extensions/mssql/package.json Adds dependencies for maintenance ARM SDK and public IP detection.
extensions/mssql/package-lock.json Locks new dependencies.
extensions/mssql/l10n/bundle.l10n.json Adds localized strings for the new feature (ignored for detailed review per guidelines).
Files not reviewed (1)
  • extensions/mssql/package-lock.json: Language not supported
Comments suppressed due to low confidence (3)

extensions/mssql/src/webviews/pages/Deployment/chooseDeploymentTypePage.tsx:136

  • The keyboard handler is comparing event.key against KeyCode.Space, but KeyCode.Space corresponds to the KeyboardEvent code value ("Space"), while event.key for the spacebar is typically " ". This makes Space key activation unreliable for keyboard users. Use event.code with KeyCode.Enter/Space (and consider aligning the other cards to the same pattern).
                    onKeyDown={(event) => {
                        if (event.key === KeyCode.Enter || event.key === KeyCode.Space) {
                            event.preventDefault();
                            onDeploymentTypeChange(DeploymentType.LocalContainers);
                        }
                    }}

extensions/mssql/src/deployment/azureSqlDatabaseHelpers.ts:274

  • loadAzureComponent always sets azureComponentStatuses[payload.componentName] = ApiStatus.Loaded after the loader runs. Several loaders set the status to ApiStatus.Error on missing prerequisites, but this assignment overwrites the error state and can cause the UI to treat failed components as successfully loaded. Only set Loaded when the loader succeeded (or set Loading before await and leave Error intact).
        }

        azureSqlState.azureComponentStatuses[payload.componentName] = ApiStatus.Loaded;
        state.deploymentTypeState = azureSqlState;
        return state;

extensions/mssql/src/deployment/azureSqlDatabaseHelpers.ts:359

  • createFirewallRuleWithVscodeAccount(...) is fired-and-forgotten without a .catch(...)/await. If it throws (e.g., publicIp is empty or token construction fails), this can surface as an unhandled promise rejection in the extension host. Consider guarding when publicIp is unavailable and/or awaiting the call in a try/catch (or explicitly handling rejection with logging).
                            accountId: azureSqlState.formState.accountId,
                            tenantId: azureSqlState.formState.tenantId,
                        },
                        ip: azureSqlState.publicIp,
                    } as FirewallRuleSpec,

Comment on lines +85 to +88
const handleAddTag = () => {
setTagError(undefined);
onTagsChange([...tags, { id: tagIdCounter.current++, key: "", value: "" }]);
};
Comment on lines +149 to +153
const tagsRecord: Record<string, string> = {};
for (const tag of tags) {
const trimmedKey = tag.key.trim();
if (trimmedKey) {
tagsRecord[trimmedKey] = tag.value;
integratedAndSecureDescription: l10n.t(
"Built-in encryption, firewall rules, and Microsoft Entra ID integration to protect your data.",
),
learnMore: l10n.t("Learn more"),
Comment on lines +171 to +219
export async function initializeAzureSqlDatabaseState(
deploymentController: DeploymentWebviewController,
groupOptions: FormItemOptions[],
logger: Logger,
selectedGroupId: string | undefined,
): Promise<asd.AzureSqlDatabaseState> {
cachedLogger = logger;
clearAllCaches();
const startTime = Date.now();
const state = new asd.AzureSqlDatabaseState();

state.formState = {
accountId: "",
tenantId: "",
subscriptionId: "",
resourceGroup: "",
serverName: "",
databaseName: "",
authenticationType: AuthenticationType.AzureMFA,
userName: "",
password: "",
savePassword: false,
autoPauseDelay: 60,
profileName: "",
groupId: selectedGroupId || groupOptions[0]?.value || "",
collation: COLLATION_OPTIONS[0],
maintenanceConfig: "",
dataSource: "",
enableAlwaysEncrypted: false,
};
try {
state.publicIp = await publicIpv4.v4();
} catch {
state.publicIp = "";
logger.warn("Could not detect public IP for firewall rule");
}

deploymentController.state.deploymentTypeState = state;
state.formComponents = setAzureSqlDatabaseFormComponents([], [], groupOptions, [], []);
state.loadState = ApiStatus.Loaded;
sendActionEvent(
TelemetryViews.AzureSqlDatabase,
TelemetryActions.StartAzureSqlDatabaseDeployment,
{},
{ azureSqlDatabaseInitTimeInMs: Date.now() - startTime },
);

return state;
}
@github-actions
Copy link
Copy Markdown

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 78068 KB 78136 KB ⚪ 68 KB ( 0% )
sql-database-projects VSIX 6310 KB 6310 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

❌ Patch coverage is 20.24609% with 1426 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.06%. Comparing base (196dcae) to head (64e1201).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ns/mssql/src/deployment/azureSqlDatabaseHelpers.ts 9.47% 1041 Missing ⚠️
...ensions/mssql/src/connectionconfig/azureHelpers.ts 21.68% 177 Missing ⚠️
...tensions/mssql/src/webviews/common/locConstants.ts 1.44% 136 Missing ⚠️
...ssql/src/deployment/deploymentWebviewController.ts 11.36% 39 Missing ⚠️
...ons/mssql/src/sharedInterfaces/azureSqlDatabase.ts 78.14% 33 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #22105      +/-   ##
==========================================
- Coverage   74.85%   74.06%   -0.80%     
==========================================
  Files         395      397       +2     
  Lines      120544   122325    +1781     
  Branches     7218     7220       +2     
==========================================
+ Hits        90237    90594     +357     
- Misses      30307    31731    +1424     
Flag Coverage Δ
data-workspace 77.10% <ø> (ø)
mssql 73.65% <20.24%> (-0.90%) ⬇️
sqlproj 77.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
extensions/mssql/src/constants/locConstants.ts 75.98% <100.00%> (+0.35%) ⬆️
...xtensions/mssql/src/sharedInterfaces/deployment.ts 94.92% <100.00%> (+0.57%) ⬆️
extensions/mssql/src/sharedInterfaces/form.ts 100.00% <100.00%> (ø)
extensions/mssql/src/sharedInterfaces/telemetry.ts 100.00% <100.00%> (ø)
...ons/mssql/src/sharedInterfaces/azureSqlDatabase.ts 78.14% <78.14%> (ø)
...ssql/src/deployment/deploymentWebviewController.ts 21.42% <11.36%> (-1.59%) ⬇️
...tensions/mssql/src/webviews/common/locConstants.ts 28.05% <1.44%> (-1.38%) ⬇️
...ensions/mssql/src/connectionconfig/azureHelpers.ts 61.72% <21.68%> (-11.23%) ⬇️
...ns/mssql/src/deployment/azureSqlDatabaseHelpers.ts 9.47% <9.47%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants