microsoft / vscode-azurestaticwebapps

Azure Static Web Apps extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps
MIT License
88 stars 35 forks source link

The error message is unclear when creating a basic static web app which name is only one letter #608

Open v-mengwe opened 2 years ago

v-mengwe commented 2 years ago

OS: Win10 Build Version: 20220123.1 Regression: Not a regression

Repro Steps:

  1. Create a basic static web app with name is only one letter, e.g. "t".
  2. Check whether the error message is clear.

Expect: The error message is clear.

Actual: The error message is unclear. image Output Details:

6:11:26 PM: Creating resource group "t" in location "Central US"...
6:11:27 PM: Successfully created resource group "t".
6:11:27 PM: Creating new static web app "t"...
6:11:27 PM: Error: "resourceGroupName" with value "t" should satisfy the constraint "Pattern": /^[-\w\._\(\)]+[^\.]$/.

More Info:

  1. This issue also reproduces when creating an advanced static web app with a resource group named only one letter, e.g. "t".
  2. This issue doesn't reproduce when creating an advanced static web app with other resource group, e.g. "test".
  3. Succeed to create a resource group which name is only one letter.
nturinski commented 2 years ago

For some reason, apps can't be created in a resource group that only has 1 character in its name, even though that is a valid name when you create a resource group (in the portal as well). This also reproduces in Functions. I don't have the heart to check all of the other extensions for this weird behavior.

I'm not sure what we can do about it except filter out any resource groups that are not longer than 1 character in length, but I don't think I would want to proceed with that solution.