Skip to content

azure: Add async validation for storage account name step#2249

Merged
nturinski merged 2 commits intomainfrom
nat/azure/storageNameFix
Mar 30, 2026
Merged

azure: Add async validation for storage account name step#2249
nturinski merged 2 commits intomainfrom
nat/azure/storageNameFix

Conversation

@nturinski
Copy link
Copy Markdown
Member

@nturinski nturinski commented Mar 26, 2026

According to the big C, this was the issue:

I've identified the root cause. The @microsoft/vscode-azext-utils library wraps validateInput with validOnTimeoutOrException which has a 2-second timeout — if the API call takes longer, validation silently returns undefined (valid), and for blob/file/queue/table there's no duplicate check at all.

So moving to the asyncValidate call should fix this.

Summary

Splits the storage account name validation in StorageAccountNameStep into synchronous and asynchronous parts:

  • validateStorageAccountNameSync — Performs instant client-side checks (length constraints, invalid characters) so the user gets immediate feedback while typing.
  • validateStorageAccountNameAvailability — Calls checkNameAvailability on the storage management client asynchronously via the new asyncValidationTask input box option, so the availability check no longer blocks the synchronous validation path.

This improves the responsiveness of the storage account name input box by deferring the network call to the async validation task.

Copilot AI review requested due to automatic review settings March 26, 2026 23:41
@nturinski nturinski requested a review from a team as a code owner March 26, 2026 23:41
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 improves the UX responsiveness of the storage account name prompt by splitting validation into immediate synchronous checks and a deferred async availability check, using asyncValidationTask to avoid blocking the typing/validation loop with a network call.

Changes:

  • Split storage account name validation into validateStorageAccountNameSync (local rules) and validateStorageAccountNameAvailability (ARM checkNameAvailability).
  • Wire validateInput to the sync validator and asyncValidationTask to the availability check in the input box prompt.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread azure/src/wizard/StorageAccountNameStep.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bwateratmsft bwateratmsft changed the title Add async validation for storage account name step azure: Add async validation for storage account name step Mar 27, 2026
@nturinski nturinski merged commit a139fcd into main Mar 30, 2026
5 of 7 checks passed
@nturinski nturinski deleted the nat/azure/storageNameFix branch March 30, 2026 16:31
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