1

sathish@Azure:~/quickstart/python-docs-hello-world$ az webapp up -n appname The command failed with an unexpected error. Here is the traceback:

Parameter 'resource_group_name' must conform to the following pattern: '^[-\\w\\._\\(\\)]+$'.
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 326, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 384, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 375, in _run_job
    cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/commands.py", line 54, in _polish_bad_errors
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 354, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 145, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 451, in default_command_handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 2313, in webapp_up
    _create_new_rg = should_create_new_rg(cmd, default_rg, rg_name, is_linux)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_create_util.py", line 282, in should_create_new_rg
    elif (_check_resource_group_exists(cmd, rg_name) and
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_create_util.py", line 86, in _check_resource_group_exists
    return rcf.resource_groups.check_existence(rg_name)
  File "/opt/az/lib/python3.6/site-packages/azure/mgmt/resource/resources/v2018_05_01/operations/resource_groups_operations.py", line 61, in check_existence
    'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
  File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 592, in url
    data = self.validate(data, name, required=True, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 672, in validate
    raise ValidationError(key, name, value)
msrest.exceptions.ValidationError: Parameter 'resource_group_name' must conform to the following pattern: '^[-\\w\\._\\(\\)]+$'.

To open an issue, please run: 'az feedback'
rdas
  • 20,604
  • 6
  • 33
  • 46
  • Whatever resource group you had specified in the request to azure does not follow what azure is expecting. It even told you what regex the name must conform to. `^[-\\w\\._\\(\\)]+$` – rdas Apr 23 '19 at 15:30
  • are any other solutions there? Because resource group name is matching with default regex pattern. Kindly provide any other solution for this. – Sathish Kannan Apr 25 '19 at 08:48

2 Answers2

1

I had this problem, but resolved it by removing the quotes around the resource group name. Silly mistake on my behalf, but may be the issue here.

e.g. use az group create -n my-groupname-rg -l northeurope rather than: e.g. use az group create -n 'my-groupname-rg' -l 'northeurope'

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
Regianni
  • 229
  • 1
  • 3
  • 11
0

For resource group name, you should take a look at Naming rules and restrictions:

enter image description here

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • Hello, if the answer helps, please help mark it as an answer. Thanks. – Ivan Glasenberg Apr 25 '19 at 00:41
  • @SathishKannan, here is a similar [issue](https://github.com/Azure/azure-cli/issues/9050), can you try to [install the cli](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) locally, then use local azure cli for this test? – Ivan Glasenberg Apr 25 '19 at 09:33