Azure / Azure/azure-rest-api-specs

Webapp:az appservice plan create failed

Open
#12,416 4 comments 0 reactions 0 assignees View on GitHub
App Services Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

**Describe the bug**
I can create a new resource group named `1` both with azure cli and azure portal. While I want an app service plan in this resource group, I failed to create it with azure cli since there is a validator forces me to follow a weird regex pattern.
I try other resources like storage account and succeed create it in the resource group with azure cli and also succeed create a new app service plan in the resource group. I doubt if the validator necessary.

```
> az appservice plan create -g 1 -n testplan
ValidationError: Parameter 'resource_group_name' must conform to the following pattern: '^[-\\w\\._\\(\\)]+[^\\.]$'.
```
**To Reproduce**
Run below command
```
az group create -n 1 -l westus2
az appservice plan create -n test -g 1
az storage account create -n test -g 1
```
**Expected behavior**
App service plan can be created in the resource group `1` just as storage account dose.

**Environment summary**

My cli version:
"azure-cli": "2.15.1",
"azure-cli-core": "2.15.1",
"azure-cli-telemetry": "1.0.6"

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the listed az group, appservice plan, and storage account commands, then locate the validator for the app service plan's resource_group_name parameter. Compare its pattern with the working storage-account path; done means an app service plan can be created in resource group `1` without weakening valid-name checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.