Describe the bug
Azure automatically creates a resource-group for you. Mine is called "cloud-shell-storage-northeurope".
To Reproduce
Click "Cloud Shell"
Choose a storage solution
mkdir
cd
az webapp up -n
Expected behavior
I expected the 'resource_group_name' automatically generated by Azure not to fail it's own validation.
Environment summary
Azure CLI 2.0
Additional context
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\._\(\)]+$'.
Any update on the error?
Experiencing the same error after 5days too...
@panchagnula for comment.
Any update on the error?
Experiencing the same error after 5days too...
So after a frustrating week with Azure, I figured out that my issue was actually with their docs.
There's a step that says "click shell", then no explanation of what happens shortly after which is you are prompted to choose a storage option / sign up to a subscription.
This creates a resource group name by itself: cloud-shell-storage-
If you continue following the OFFICIAL DOCS, it says to enter "az webapp up -n". It doesn't say anything about linking your webapp to the automatically generated resource group. So I think the app is trying to find one that doesn't exist, and fails.
I solved the issue by using AWS instead.
EDIT:
If you're stuck with using Azure, after you select storage, check the "resource groups" tab and use the resource name given there in the steps that follow.
I'm having the same issue and thus I'm unable to deploy my app. It worked a few weeks ago with the exact same procedure.
Following the tutorial: https://docs.microsoft.com/en-us/azure/app-service/containers/quickstart-python
new file share, i.e.:myappfs
Then I login and clone my git repository.
I run the following command, which fails with the exact same error as provided by @ronaldgreeff:
az webapp up -n myapp -l westeurope --sku S1 --dryrun
Running Get-CloudDrive on the PowerShell gives
FileShareName : myappfs
FileSharePath : //myappstorage.file.core.windows.net/myappfs
MountPoint : /home/jofroe/clouddrive
Name : myappstorage
ResourceGroupName : myapprg
StorageAccountName : myappstorage
SubscriptionId : xxx
True, following the tutorial worked good till about a week back. And now it does not. Even after specifying the resource group it gives the same error.
I got the same following the simple document https://docs.microsoft.com/en-gb/azure/app-service/containers/quickstart-python
I see that this error is specific to cloud shell, in the meanwhile you can try by installing CLI directly
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
I am not sure what changed on cloud shell, will take a look One thing has anyone tried running the command with --debug command at the end to see if you get any detailed error message when running on cloud shell?
I just tried to run the example posted on tutorial by @JackHasABoat above below is my analysis
I believe #1 above should fix the issue, I will follow up to see of the extension can be removed from cloudShell, & also update the version of SDK the webapp extension uses, the problem is that azure-cli-core webapp uses a newer SDK version compared to the extension.
Here's the debug output:
jofroe@Azure:~/myapp$ az extension list
[]
jofroe@Azure:~/myapp$ az webapp up -n myapp -l westeurope --sku S1 --dryrun --debug
Command arguments: ['webapp', 'up', '-n', 'myapp', '-l', 'westeurope', '--sku', 'S1', '--dryrun', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fc2134d68c8>, <function OutputProducer.on_global_arguments at 0x7fc213017620>, <function CLIQuery.on_global_arguments at 0x7fc21303b0d0>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'maps', 'monitor', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.004 seconds.
Loaded module 'acs' in 0.004 seconds.
Loaded module 'advisor' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.017 seconds.
Loaded module 'appservice' in 0.007 seconds.
Loaded module 'backup' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.009 seconds.
Loaded module 'batchai' in 0.003 seconds.
Loaded module 'billing' in 0.002 seconds.
Loaded module 'botservice' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.003 seconds.
Loaded module 'cloud' in 0.001 seconds.
Loaded module 'cognitiveservices' in 0.002 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.002 seconds.
Loaded module 'container' in 0.002 seconds.
Loaded module 'cosmosdb' in 0.003 seconds.
Loaded module 'dla' in 0.004 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.002 seconds.
Loaded module 'eventhubs' in 0.004 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.003 seconds.
Loaded module 'find' in 0.001 seconds.
Loaded module 'hdinsight' in 0.002 seconds.
Loaded module 'interactive' in 0.000 seconds.
Loaded module 'iot' in 0.004 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.006 seconds.
Loaded module 'kusto' in 0.002 seconds.
Loaded module 'lab' in 0.004 seconds.
Loaded module 'maps' in 0.001 seconds.
Loaded module 'monitor' in 0.005 seconds.
Loaded module 'network' in 0.031 seconds.
Loaded module 'policyinsights' in 0.002 seconds.
Loaded module 'privatedns' in 0.005 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.005 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.007 seconds.
Loaded module 'role' in 0.004 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'security' in 0.002 seconds.
Loaded module 'servicebus' in 0.003 seconds.
Loaded module 'servicefabric' in 0.001 seconds.
Loaded module 'signalr' in 0.001 seconds.
Loaded module 'sql' in 0.005 seconds.
Loaded module 'sqlvm' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.027 seconds.
Loaded module 'vm' in 0.010 seconds.
Loaded all modules in 0.228 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/jofroe/.azure/cliextensions'
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fc212da3510>]
az_command_data_logger : command args: webapp up -n {} -l {} --sku {} --dryrun --debug
metadata file logging enabled - writing logs to '/home/jofroe/.azure/commands'.
Event: CommandInvoker.OnPostCommandTableCreate [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7fc212d46488>, <function register_ids_argument.<locals>.add_ids_arguments at 0x7fc212d71ea0>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7fc210a2f840>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7fc2130176a8>, <function CLIQuery.handle_query_parameter at 0x7fc21303b158>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7fc212d71f28>, <function handler at 0x7fc2109169d8>]
Getting management service client client_type=WebSiteManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
Current cloud config:
AzureCloud
Getting management service client client_type=WebSiteManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
Getting management service client client_type=ResourceManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
msrest.exceptions : Parameter 'resource_group_name' must conform to the following pattern: '^[-\\w\\._\\(\\)]+$'.
cli.azure.cli.core.util : The command failed with an unexpected error. Here is the traceback:
The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.util : 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\\._\\(\\)]+$'.
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\\._\\(\\)]+$'.
cli.azure.cli.core.util :
To open an issue, please run: 'az feedback'
To open an issue, please run: 'az feedback'
az_command_data_logger : exit code: 1
telemetry.save : Save telemetry record of length 2437 in cache
telemetry.check : Negative: The /home/jofroe/.azure/telemetry.txt was modified at 2019-04-16 12:03:29.328931, which in less than 600.000000 s
command ran in 2.753 seconds.
@jofroe thanks for sharing here what I see when I run the above command

Do you have a default resource group configured on CLI using az configure --defaults
if so try to reset this using az configure --defaults group=''
Hm it does not seem to work with resetting the config. It is a fresh instance anyways:
jofroe@Azure:~/quickstart/python-docs-hello-world$ az configure
Welcome to the Azure CLI! This command will guide you through logging in and setting some default values.
Your settings can be found at /home/jofroe/.azure/config
Your current configuration is as follows:
[cloud]
name = AzureCloud
[defaults]
group =
[core]
first_run = yes
Environment variables:
AZURE_ACCESS_TOKEN_FILE = /tmp/accessTokens.json
AZURE_HTTP_USER_AGENT = cloud-shell/1.0
@jofroe I might have an idea on what's happening here. we recently made a change to az web app up command where we use the logged username as the prefix to a RG or Appserviceplan name, so that the resources unique to the user. Looking at the above snippet of log you shared I see no username associated on cloudShell i.e @Azure - instead of username@Azure. I will definitely add error handling on my end for this - however I am not sure why cloud shell has no username in this case.
@panchagnula Sorry, this is my fault. I removed my username from the logs since I did not want to share it publicly. I have edited the logs above and added my github pseudonym. It should be more clear now.
@jofroe thanks for the clarification - if this is the case then I am not really sure why the command is failing!
One last thing if you can share the version of CLI on cloud shell . this is the version I am using
azure-cli 2.0.62
appservice 0.2.17
@panchagnula I have the same version of CLI on cloud shell.
jofroe@Azure:~$ az --version
azure-cli 2.0.62
appservice 0.2.17
@jofroe what happens if you try the command this way
az webapp up -n myapp -l 'west Europe". I have seen this error message show up when the command was not used correctly.
@panchagnula trying the same format with below, results in the same error:
az webapp up -l 'east US' -n myapp
ok this is rather bizzare. I am sorry for all the inconvenience this is causing.
After you run #1 above can you share the name of the app you were using the exact date time in UTC you tried this operation let me see if I find anything on our backend logs - though I don't think this is azure error but more with CLI
Also can you confirm if you are seeing the same behavior when not using CloudShell but using locally installed CLI? Thank you.
@panchagnula here are the details:
App Name - hbsportal
UTC Time: 6:39am /18-04-2019
--dryrun output with execution timestamp:
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ date;az webapp up -n Jack_webapp_test3 --dryrun
Thu Apr 18 07:02:55 UTC 2019
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'
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$
@panchagnula Here's everything else being tried following the suggestions. Similar to others this is a new Azure account. And I'm using Free Trial. If you have a new account to have a try, there's a good chance to reproduce it. It's a very bad experience to start playing with Azure by following this quickstart-python guide.
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az extension list
[]
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az webapp up -n Jack_webapp_test1
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'
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az webapp up -n Jack_webapp_test1 --debug
Command arguments: ['webapp', 'up', '-n', 'Jack_webapp_test1', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'maps', 'monitor', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.004 seconds.
Loaded module 'acs' in 0.003 seconds.
Loaded module 'advisor' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.016 seconds.
Loaded module 'appservice' in 0.007 seconds.
Loaded module 'backup' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.008 seconds.
Loaded module 'batchai' in 0.003 seconds.
Loaded module 'billing' in 0.002 seconds.
Loaded module 'botservice' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.002 seconds.
Loaded module 'cloud' in 0.001 seconds.
Loaded module 'cognitiveservices' in 0.001 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.002 seconds.
Loaded module 'container' in 0.002 seconds.
Loaded module 'cosmosdb' in 0.003 seconds.
Loaded module 'dla' in 0.004 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.002 seconds.
Loaded module 'eventhubs' in 0.003 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.001 seconds.
Loaded module 'hdinsight' in 0.002 seconds.
Loaded module 'interactive' in 0.000 seconds.
Loaded module 'iot' in 0.004 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.005 seconds.
Loaded module 'kusto' in 0.002 seconds.
Loaded module 'lab' in 0.003 seconds.
Loaded module 'maps' in 0.001 seconds.
Loaded module 'monitor' in 0.004 seconds.
Loaded module 'network' in 0.028 seconds.
Loaded module 'policyinsights' in 0.002 seconds.
Loaded module 'privatedns' in 0.004 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.005 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.007 seconds.
Loaded module 'role' in 0.004 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'security' in 0.002 seconds.
Loaded module 'servicebus' in 0.004 seconds.
Loaded module 'servicefabric' in 0.002 seconds.
Loaded module 'signalr' in 0.001 seconds.
Loaded module 'sql' in 0.006 seconds.
Loaded module 'sqlvm' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.030 seconds.
Loaded module 'vm' in 0.013 seconds.
Loaded all modules in 0.222 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/jackhasaboat/.azure/cliextensions'
Event: CommandInvoker.OnPreCommandTableTruncate [
az_command_data_logger : command args: webapp up -n {} --debug
metadata file logging enabled - writing logs to '/home/jackhasaboat/.azure/commands'.
Event: CommandInvoker.OnPostCommandTableCreate [
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [
Event: CommandInvoker.OnPostParseArgs [
Getting management service client client_type=WebSiteManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
Current cloud config:
AzureCloud
Getting management service client client_type=WebSiteManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
msrest.async_paging : Paging async iterator protocol is not available for GeoRegionPaged
urllib3.connectionpool : Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool : http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2060
msrestazure.azure_active_directory : MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
urllib3.connectionpool : Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool : http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2060
msrestazure.azure_active_directory : MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions?sku=P1V2&linuxWorkersEnabled=true&api-version=2018-02-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : 'User-Agent': 'python/3.6.5 (Linux-4.15.0-1041-azure-x86_64-with-debian-stretch-sid) msrest/0.6.6 cloud-shell/1.0 msrest_azure/0.6.0 azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.62 cloud-shell/1.0'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions?sku=P1V2&linuxWorkersEnabled=true&api-version=2018-02-01 HTTP/1.1" 200 None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Transfer-Encoding': 'chunked'
msrest.http_logger : 'Content-Type': 'application/json'
msrest.http_logger : 'Content-Encoding': 'gzip'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'Vary': 'Accept-Encoding'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'x-ms-request-id': 'b9448816-c1ff-4367-90a0-b1e9ba3556af'
msrest.http_logger : 'Server': 'Microsoft-IIS/10.0'
msrest.http_logger : 'X-AspNet-Version': '4.0.30319'
msrest.http_logger : 'X-Powered-By': 'ASP.NET'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '11999'
msrest.http_logger : 'x-ms-correlation-request-id': 'b7e48905-fa04-4a3f-9467-1495e7c50054'
msrest.http_logger : 'x-ms-routing-request-id': 'SOUTHEASTASIA:20190418T065601Z:b7e48905-fa04-4a3f-9467-1495e7c50054'
msrest.http_logger : 'X-Content-Type-Options': 'nosniff'
msrest.http_logger : 'Date': 'Thu, 18 Apr 2019 06:56:00 GMT'
msrest.http_logger : Response content:
msrest.http_logger : {"value":[{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Central US","name":"Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"Central US","description":null,"sortOrder":0,"displayName":"Central US"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/North Europe","name":"North Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"North Europe","description":null,"sortOrder":1,"displayName":"North Europe"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/West Europe","name":"West Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"West Europe","description":null,"sortOrder":2,"displayName":"West Europe"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Southeast Asia","name":"Southeast Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"Southeast Asia","description":null,"sortOrder":3,"displayName":"Southeast Asia"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/East Asia","name":"East Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"East Asia","description":null,"sortOrder":4,"displayName":"East Asia"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/West US","name":"West US","type":"Microsoft.Web/geoRegions","properties":{"name":"West US","description":null,"sortOrder":5,"displayName":"West US"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/East US","name":"East US","type":"Microsoft.Web/geoRegions","properties":{"name":"East US","description":null,"sortOrder":6,"displayName":"East US"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Japan West","name":"Japan West","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan West","description":null,"sortOrder":7,"displayName":"Japan West"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Japan East","name":"Japan East","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan East","description":null,"sortOrder":8,"displayName":"Japan East"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/East US 2","name":"East US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"East US 2","description":null,"sortOrder":9,"displayName":"East US 2"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/North Central US","name":"North Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"North Central US","description":null,"sortOrder":10,"displayName":"North Central US"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/South Central US","name":"South Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"South Central US","description":null,"sortOrder":11,"displayName":"South Central US"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Brazil South","name":"Brazil South","type":"Microsoft.Web/geoRegions","properties":{"name":"Brazil South","description":null,"sortOrder":12,"displayName":"Brazil South"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Australia East","name":"Australia East","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia East","description":null,"sortOrder":13,"displayName":"Australia East"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Australia Southeast","name":"Australia Southeast","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia Southeast","description":null,"sortOrder":14,"displayName":"Australia Southeast"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/North CentralUS (Stage)","name":"North Central US (Stage)","type":"Microsoft.Web/geoRegions","properties":{"name":"North Central US (Stage)","description":null,"sortOrder":2147483647,"displayName":"North Central US (Stage)"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Central India","name":"Central India","type":"Microsoft.Web/geoRegions","properties":{"name":"Central India","description":null,"sortOrder":2147483647,"displayName":"Central India"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/West India","name":"West India","type":"Microsoft.Web/geoRegions","properties":{"name":"West India","description":null,"sortOrder":2147483647,"displayName":"West India"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/South India","name":"SouthIndia","type":"Microsoft.Web/geoRegions","properties":{"name":"South India","description":null,"sortOrder":2147483647,"displayName":"South India"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Canada Central","name":"Canada Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada Central","description":null,"sortOrder":2147483647,"displayName":"Canada Central"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Canada East","name":"Canada East","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada East","description":null,"sortOrder":2147483647,"displayName":"Canada East"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/West Central US","name":"West Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"West Central US","description":null,"sortOrder":2147483647,"displayName":"West Central US"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/West US 2","name":"West US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"WestUS 2","description":null,"sortOrder":2147483647,"displayName":"West US 2"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/UK West","name":"UK West","type":"Microsoft.Web/geoRegions","properties":{"name":"UK West","description":null,"sortOrder":2147483647,"displayName":"UK West"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/UK South","name":"UK South","type":"Microsoft.Web/geoRegions","properties":{"name":"UK South","description":null,"sortOrder":2147483647,"displayName":"UK South"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Central US EUAP","name":"Central US EUAP","type":"Microsoft.Web/geoRegions","properties":{"name":"Central US EUAP","description":null,"sortOrder":2147483647,"displayName":"Central US EUAP"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Korea South","name":"Korea South","type":"Microsoft.Web/geoRegions","properties":{"name":"Korea South","description":null,"sortOrder":2147483647,"displayName":"Korea South"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/Korea Central","name":"Korea Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Korea Central","description":null,"sortOrder":2147483647,"displayName":"Korea Central"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/France Central","name":"France Central","type":"Microsoft.Web/geoRegions","properties":{"name":"France Central","description":null,"sortOrder":2147483647,"displayName":"France Central"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/South Africa North","name":"South Africa North","type":"Microsoft.Web/geoRegions","properties":{"name":"South Africa North","description":null,"sortOrder":2147483647,"displayName":"South Africa North"}},{"id":"/subscriptions/4c35434d-1e98-4e3f-862f-f20eed0f056c/providers/Microsoft.Web/geoRegions/South Africa West","name":"South Africa West","type":"Microsoft.Web/geoRegions","properties":{"name":"South Africa West","description":null,"sortOrder":2147483647,"displayName":"South Africa West"}}],"nextLink":null,"id":null}
Getting management service client client_type=ResourceManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
msrest.exceptions : Parameter 'resource_group_name' must conform to the following pattern: '^[-\w\._\(\)]+$'.
cli.azure.cli.core.util : The command failed with an unexpected error. Here is the traceback:
The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.util : 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\._\(\)]+$'.
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\._\(\)]+$'.
cli.azure.cli.core.util :
To open an issue, please run: 'az feedback'
To open an issue, please run: 'az feedback'
az_command_data_logger : exit code: 1
telemetry.save : Save telemetry record of length 2419 in cache
telemetry.check : Negative: The /home/jackhasaboat/.azure/telemetry.txt was modified at 2019-04-18 06:50:39.290967, which in less than 600.000000s
command ran in 1.901 seconds.
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az configure --defaults
az configure: error: argument --defaults/-d: expected at least one argument
usage: az configure [-h] [--verbose] [--debug]
[--output {json,jsonc,table,tsv,yaml,none}]
[--query JMESPATH] [--defaults DEFAULTS [DEFAULTS ...]]
[--subscription _SUBSCRIPTION]
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az configure
Welcome to the Azure CLI! This command will guide you through logging in and setting some default values.
Your settings can be found at /home/jackhasaboat/.azure/config
Your current configuration is as follows:
[cloud]
name = AzureCloud
Environment variables:
AZURE_ACCESS_TOKEN_FILE = /tmp/accessTokens.json
AZURE_HTTP_USER_AGENT = cloud-shell/1.0
Do you wish to change your settings? (y/N): n
You're all set! Here are some commands to try:
$ az login
$ az vm create --help
$ az feedback
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az configure --defaults
az configure: error: argument --defaults/-d: expected at least one argument
usage: az configure [-h] [--verbose] [--debug]
[--output {json,jsonc,table,tsv,yaml,none}]
[--query JMESPATH] [--defaults DEFAULTS [DEFAULTS ...]]
[--subscription _SUBSCRIPTION]
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az --version
azure-cli 2.0.62
acr 2.2.4
acs 2.3.21
advisor 2.0.0
ams 0.4.4
appservice 0.2.17
backup 1.2.3
batch 4.0.0
batchai 0.4.8
billing 0.2.1
botservice 0.1.10
cdn 0.2.2
cloud 2.1.1
cognitiveservices 0.2.5
command-modules-nspkg 2.0.2
configure 2.0.21
consumption 0.4.2
container 0.3.16
core 2.0.62
cosmosdb 0.2.9
dla 0.2.5
dls 0.1.8
dms 0.1.3
eventgrid 0.2.2
eventhubs 0.3.4
extension 0.2.5
feedback 2.2.0
find 0.3.2
hdinsight 0.3.3
interactive 0.4.3
iot 0.3.7
iotcentral 0.1.6
keyvault 2.2.14
kusto 0.2.2
lab 0.1.6
maps 0.3.4
monitor 0.2.12
network 2.3.6
nspkg 3.0.3
policyinsights 0.1.2
privatedns 1.0.0
profile 2.1.5
rdbms 0.3.9
redis 0.4.2
relay 0.1.4
reservations 0.4.2
resource 2.1.13
role 2.5.0
search 0.1.1
security 0.1.1
servicebus 0.3.4
servicefabric 0.1.16
signalr 1.0.0
sql 2.2.1
sqlvm 0.1.1
storage 2.4.0
telemetry 1.0.2
vm 2.2.18
Python location '/opt/az/bin/python3'
Extensions directory '/home/jackhasaboat/.azure/cliextensions'
Python (Linux) 3.6.5 (default, Apr 4 2019, 22:51:52)
[GCC 5.4.0 20160609]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az webapp up -n Jack_webapp_test2 -l 'west Europe'
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'
jackhasaboat@Azure:~/quickstart/python-docs-hello-world$ az webapp up -n Jack_webapp_test3 --dryrun
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'
Ok I downloaded az CLI, the same version "azure-cli 2.0.62".
As a start it corrected me to update the invalid name. I changed it from sth like Jack_webapp to Jack-webapp then everything worked perfectly.
So it looks like to me the problem is with Azure Cloud Shell only.
Using the valid app name I still got failure on Cloud Shell.
The command failed with an unexpected error. Here is the traceback:
glob() got an unexpected keyword argument 'recursive'
Traceback (most recent call last):
File "/root/lib/azure-cli/local/lib/python2.7/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/root/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 326, in execute
raise ex
TypeError: glob() got an unexpected keyword argument 'recursive'
To open an issue, please run: 'az feedback'
@sumgro , apologize for the delay here - the Python version being used here seems to 2.7 , which is not compatible with the glob method used in the command - can you verify your version of Python used & update to newer version if possible & re-try?
@panchagnula I've got both Python 2.7 and Python 3.6. How can i make the azure-cli use the python3 instead of python2?
Additionally, when bringing up the web app from cloud shell, I use to go to a specific directory path when the files where located. how can I traverse to the same path using the local azure-cli command?
Thanks
if you don't need Python 2.7 - just delete it or use aliasing using the command
alias python=python3 -> once you run this confirm that the version by running python --version
Also, regarding running up from the directory you can follow the exact same instructions as in the documentation, git clone "the Project' & then cd to the directory.
Hi @panchagnula, I need python2.7 and hence using the alias python=python3 will break the system as the default version is 2.7.
Is there an alternative command to allow azure-cli to use the python3 instead of the default 2.7 one?
Update: I've been able to have azure-cli working through the guide here - https://github.com/Azure/azure-cli/issues/2529
So now I'm able to deploy the app through azure-cli, while the cloud shell is still giving error.
Thanks
Hi @panchagnula, I am experiencing the same error:
jaime@Azure:~/quickstart/python-docs-hello-world$ python --version
Python 3.5.2
jaime@Azure:~/quickstart/python-docs-hello-world$ az webapp up -n jaime_webapp_test --debug
Command arguments: ['webapp', 'up', '-n', 'jaime_webapp_test', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'maps', 'monitor', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.004 seconds.
Loaded module 'acs' in 0.004 seconds.
Loaded module 'advisor' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.016 seconds.
Loaded module 'appservice' in 0.006 seconds.
Loaded module 'backup' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.008 seconds.
Loaded module 'batchai' in 0.003 seconds.
Loaded module 'billing' in 0.001 seconds.
Loaded module 'botservice' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.002 seconds.
Loaded module 'cloud' in 0.001 seconds.
Loaded module 'cognitiveservices' in 0.002 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.002 seconds.
Loaded module 'container' in 0.002 seconds.
Loaded module 'cosmosdb' in 0.003 seconds.
Loaded module 'dla' in 0.004 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.002 seconds.
Loaded module 'eventhubs' in 0.003 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.001 seconds.
Loaded module 'hdinsight' in 0.002 seconds.
Loaded module 'interactive' in 0.000 seconds.
Loaded module 'iot' in 0.003 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.005 seconds.
Loaded module 'kusto' in 0.002 seconds.
Loaded module 'lab' in 0.003 seconds.
Loaded module 'maps' in 0.001 seconds.
Loaded module 'monitor' in 0.004 seconds.
Loaded module 'network' in 0.026 seconds.
Loaded module 'policyinsights' in 0.001 seconds.
Loaded module 'privatedns' in 0.004 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.005 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.007 seconds.
Loaded module 'role' in 0.004 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'security' in 0.002 seconds.
Loaded module 'servicebus' in 0.004 seconds.
Loaded module 'servicefabric' in 0.002 seconds.
Loaded module 'signalr' in 0.001 seconds.
Loaded module 'sql' in 0.006 seconds.
Loaded module 'sqlvm' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.028 seconds.
Loaded module 'vm' in 0.011 seconds.
Loaded all modules in 0.212 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/jaime/.azure/cliextensions'
Event: CommandInvoker.OnPreCommandTableTruncate [
az_command_data_logger : command args: webapp up -n {} --debug
metadata file logging enabled - writing logs to '/home/jaime/.azure/commands'.
Event: CommandInvoker.OnPostCommandTableCreate [
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [
Event: CommandInvoker.OnPostParseArgs [
Getting management service client client_type=WebSiteManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
Current cloud config:
AzureCloud
Getting management service client client_type=WebSiteManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
msrest.async_paging : Paging async iterator protocol is not available for GeoRegionPaged
urllib3.connectionpool : Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool : http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 1918
msrestazure.azure_active_directory : MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
urllib3.connectionpool : Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool : http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 1918
msrestazure.azure_active_directory : MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions?sku=P1V2&linuxWorkersEnabled=true&api-version=2018-02-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : 'User-Agent': 'python/3.6.5 (Linux-4.15.0-1041-azure-x86_64-with-debian-stretch-sid) msrest/0.6.6 cloud-shell/1.0 msrest_azure/0.6.0 azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.62 cloud-shell/1.0'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions?sku=P1V2&linuxWorkersEnabled=true&api-version=2018-02-01 HTTP/1.1" 200 None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Transfer-Encoding': 'chunked'
msrest.http_logger : 'Content-Type': 'application/json'
msrest.http_logger : 'Content-Encoding': 'gzip'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'Vary': 'Accept-Encoding'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'x-ms-request-id': 'cf897a74-65ab-4c4f-a1db-0ec0dd92d30b'
msrest.http_logger : 'Server': 'Microsoft-IIS/10.0'
msrest.http_logger : 'X-AspNet-Version': '4.0.30319'
msrest.http_logger : 'X-Powered-By': 'ASP.NET'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '11997'
msrest.http_logger : 'x-ms-correlation-request-id': 'ed2b885a-2a16-4bd0-8c17-9f9e580ae180'
msrest.http_logger : 'x-ms-routing-request-id': 'EASTUS:20190422T202724Z:ed2b885a-2a16-4bd0-8c17-9f9e580ae180'
msrest.http_logger : 'X-Content-Type-Options': 'nosniff'
msrest.http_logger : 'Date': 'Mon, 22 Apr 2019 20:27:24 GMT'
msrest.http_logger : Response content:
msrest.http_logger : {"value":[{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Central US","name":"Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"Central US","description":null,"sortOrder":0,"displayName":"Central US"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/North Europe","name":"North Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"North Europe","description":null,"sortOrder":1,"displayName":"North Europe"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/West Europe","name":"West Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"West Europe","description":null,"sortOrder":2,"displayName":"West Europe"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Southeast Asia","name":"Southeast Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"Southeast Asia","description":null,"sortOrder":3,"displayName":"Southeast Asia"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/East Asia","name":"East Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"East Asia","description":null,"sortOrder":4,"displayName":"East Asia"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/West US","name":"West US","type":"Microsoft.Web/geoRegions","properties":{"name":"West US","description":null,"sortOrder":5,"displayName":"West US"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/East US","name":"East US","type":"Microsoft.Web/geoRegions","properties":{"name":"East US","description":null,"sortOrder":6,"displayName":"East US"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Japan West","name":"Japan West","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan West","description":null,"sortOrder":7,"displayName":"Japan West"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Japan East","name":"Japan East","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan East","description":null,"sortOrder":8,"displayName":"Japan East"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/East US 2","name":"East US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"East US 2","description":null,"sortOrder":9,"displayName":"East US 2"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/North Central US","name":"North Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"North Central US","description":null,"sortOrder":10,"displayName":"North Central US"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/South Central US","name":"South Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"South Central US","description":null,"sortOrder":11,"displayName":"South Central US"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Brazil South","name":"Brazil South","type":"Microsoft.Web/geoRegions","properties":{"name":"Brazil South","description":null,"sortOrder":12,"displayName":"Brazil South"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Australia East","name":"Australia East","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia East","description":null,"sortOrder":13,"displayName":"Australia East"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Australia Southeast","name":"Australia Southeast","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia Southeast","description":null,"sortOrder":14,"displayName":"Australia Southeast"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/North Central US (Stage)","name":"North Central US (Stage)","type":"Microsoft.Web/geoRegions","properties":{"name":"North Central US (Stage)","description":null,"sortOrder":2147483647,"displayName":"North Central US (Stage)"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Central India","name":"Central India","type":"Microsoft.Web/geoRegions","properties":{"name":"Central India","description":null,"sortOrder":2147483647,"displayName":"Central India"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/West India","name":"West India","type":"Microsoft.Web/geoRegions","properties":{"name":"West India","description":null,"sortOrder":2147483647,"displayName":"West India"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/South India","name":"South India","type":"Microsoft.Web/geoRegions","properties":{"name":"South India","description":null,"sortOrder":2147483647,"displayName":"South India"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Canada Central","name":"Canada Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada Central","description":null,"sortOrder":2147483647,"displayName":"Canada Central"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Canada East","name":"Canada East","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada East","description":null,"sortOrder":2147483647,"displayName":"Canada East"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/West Central US","name":"West Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"West Central US","description":null,"sortOrder":2147483647,"displayName":"West Central US"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/West US 2","name":"West US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"West US 2","description":null,"sortOrder":2147483647,"displayName":"West US 2"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/UK West","name":"UK West","type":"Microsoft.Web/geoRegions","properties":{"name":"UK West","description":null,"sortOrder":2147483647,"displayName":"UK West"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/UK South","name":"UK South","type":"Microsoft.Web/geoRegions","properties":{"name":"UK South","description":null,"sortOrder":2147483647,"displayName":"UK South"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Central US EUAP","name":"Central US EUAP","type":"Microsoft.Web/geoRegions","properties":{"name":"Central US EUAP","description":null,"sortOrder":2147483647,"displayName":"Central US EUAP"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Korea South","name":"Korea South","type":"Microsoft.Web/geoRegions","properties":{"name":"Korea South","description":null,"sortOrder":2147483647,"displayName":"Korea South"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/Korea Central","name":"Korea Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Korea Central","description":null,"sortOrder":2147483647,"displayName":"Korea Central"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/France Central","name":"France Central","type":"Microsoft.Web/geoRegions","properties":{"name":"France Central","description":null,"sortOrder":2147483647,"displayName":"France Central"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/South Africa North","name":"South Africa North","type":"Microsoft.Web/geoRegions","properties":{"name":"South Africa North","description":null,"sortOrder":2147483647,"displayName":"South Africa North"}},{"id":"/subscriptions/2e8f9e5d-24f1-43ee-bf30-b6776e3d88a4/providers/Microsoft.Web/geoRegions/South Africa West","name":"South Africa West","type":"Microsoft.Web/geoRegions","properties":{"name":"South Africa West","description":null,"sortOrder":2147483647,"displayName":"South Africa West"}}],"nextLink":null,"id":null}
Getting management service client client_type=ResourceManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
msrest.exceptions : Parameter 'resource_group_name' must conform to the following pattern: '^[-\w\._\(\)]+$'.
cli.azure.cli.core.util : The command failed with an unexpected error. Here is the traceback:
The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.util : 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\._\(\)]+$'.
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\._\(\)]+$'.
cli.azure.cli.core.util :
To open an issue, please run: 'az feedback'
To open an issue, please run: 'az feedback'
az_command_data_logger : exit code: 1
telemetry.save : Save telemetry record of length 2419 in cache
telemetry.check : Returns Positive.
telemetry.main : Begin creating telemetry upload process.
telemetry.process : Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.6/site-packages/azure/cli/telemetry/__init__.py /home/jaime/.azure"
telemetry.process : Return from creating process
telemetry.main : Finish creating telemetry upload process.
command ran in 0.688 seconds.
I have tried the same procedure using CLI on my local computer which worked. So it really seems to be an issue related to the Web CLI probably some release/update within the last weeks (?).
This is what I did (Windows 10):
cd C:\dev\git\myappaz login and login on the browser, which shows:Note, we have launched a browser for you to login. For old experience with device code, use "az login --use-device-code"
You have logged in. Now let us find all the subscriptions to which you have access...
[
{
"cloudName": "AzureCloud",
"id": "xxx",
"isDefault": true,
"name": "xxx",
"state": "Enabled",
"tenantId": "xxx",
"user": {
"name": "[email protected]",
"type": "user"
}
}
]
az webapp up -n myapp -l westeurope --sku S1Creating Resource group 'jofroe_asp_Linux_westeurope' ...
Resource group creation complete
Creating App service plan 'jofroe_asp_Linux_westeurope' ...
App service plan creation complete
Creating app 'myapp' ...
Webapp creation complete
Updating app settings to enable build after deployment
Creating zip with contents of dir C:\dev\git\myapp...
Preparing to deploy and build contents to app.This operation can take a while to complete ...
Getting scm site credentials for zip deployment
Starting zip deployment
Configuring default logging for the app, if not already enabled
Zip deployment failed. {'id': 'temp-2fa808bb', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Deploying from pushed zip file', 'progress': '', 'received_time': '2019-04-23T08:34:35.4399962Z', 'start_time': '2019-04-23T08:34:35.4399962Z', 'end_time': '2019-04-23T08:35:09.561121Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': True, 'is_readonly': False, 'url': 'https://xxx.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://xxx.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'myapp'}. Please run the command az webapp log tail
-n myapp-g jofroe_asp_Linux_westeurope
az webapp log tail -n myapp-g jofroe_asp_Linux_westeurope2019-04-23T08:36:27 Welcome, you are now connected to log-streaming service.
2019-04-23T08:35:25.887001801Z
2019-04-23T08:35:25.887040901Z _____
2019-04-23T08:35:25.887051701Z / _ \ __________ _________ ____
2019-04-23T08:35:25.887060202Z / /_\ \___ / | \_ __ \_/ __ \
2019-04-23T08:35:25.887068402Z / | \/ /| | /| | \/\ ___/
2019-04-23T08:35:25.887076502Z \____|__ /_____ \____/ |__| \___ >
2019-04-23T08:35:25.887084702Z \/ \/ \/
2019-04-23T08:35:25.887093002Z
2019-04-23T08:35:25.887100602Z A P P S E R V I C E O N L I N U X
2019-04-23T08:35:25.887108302Z
2019-04-23T08:35:25.887116202Z Documentation: http://aka.ms/webapp-linux
2019-04-23T08:35:25.887124102Z
2019-04-23T08:35:26.922799467Z Starting OpenBSD Secure Shell server: sshd.
2019-04-23T08:35:27.011088201Z App Command Line not configured, will attempt auto-detect
2019-04-23T08:35:27.021752866Z Launching oryx with: -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -hostBind 0.0.0.0:8000
2019-04-23T08:35:27.340677995Z Oryx Version : 0.2.20190223.1, Commit: xxx
2019-04-23T08:35:27.355038382Z
2019-04-23T08:35:27.405192885Z Using default app from /opt/defaultsite
2019-04-23T08:35:29.552948578Z Writing output script to '/opt/startup/startup.sh'
2019-04-23T08:35:29.656405204Z WARNING: Could not find packages folder or virtual environment.
2019-04-23T08:35:32.305758530Z [2019-04-23 08:35:32 +0000] [36] [INFO] Starting gunicorn 19.9.0
2019-04-23T08:35:32.359018252Z [2019-04-23 08:35:32 +0000] [36] [INFO] Listening at: http://0.0.0.0:8000 (36)
2019-04-23T08:35:32.398000888Z [2019-04-23 08:35:32 +0000] [36] [INFO] Using worker: sync
2019-04-23T08:35:32.437145725Z [2019-04-23 08:35:32 +0000] [39] [INFO] Booting worker with pid: 39
2019-04-23 08:34:16.630 INFO - Starting container for site
2019-04-23 08:34:16.630 INFO - docker run -d -p 16380:8000 --name myapp_0 -e WEBSITE_SITE_NAME=myapp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_INSTANCE_ID=xxx appsvc/python:3.7_1903072253
2019-04-23 08:34:16.630 INFO - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2019-04-23 08:34:44.813 INFO - Container myapp_0 for site myapp initialized successfully and is ready to serve requests.
2019-04-23 08:35:23.040 INFO - Recycling container because of HttpLoggingEnabledChange and httpLoggingEnabled = True
2019-04-23 08:35:23.099 INFO - Starting container for site
2019-04-23 08:35:23.099 INFO - docker run -d -p 31875:8000 --name myapp_1 -e WEBSITE_SITE_NAME=myapp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_INSTANCE_ID=xxx -e HTTP_LOGGING_ENABLED=1 appsvc/python:3.7_1903072253
2019-04-23 08:35:34.283 INFO - Container myapp_1 for site myapp initialized successfully and is ready to serve requests.
2019-04-23T08:36:32 No new trace in the past 0 min(s).
2019-04-23T08:36:37 No new trace in the past 0 min(s).
2019-04-23T08:36:37 No new trace in the past 0 min(s).
2019-04-23T08:36:42 No new trace in the past 0 min(s).
az webapp up -n myapp -l westeurope --sku S1Resource group 'kingjofroe_asp_Linux_westeurope' already exists.
App service plan 'kingjofroe_asp_Linux_westeurope' already exists.
App 'colormania' already exists
Updating app settings to enable build after deployment
Creating zip with contents of dir C:\dev\git\colormania ...
Preparing to deploy and build contents to app.This operation can take a while to complete ...
Getting scm site credentials for zip deployment
Starting zip deployment
All done. Launching the app in your default browser.
And now it worked. But not CLI Web ..
@tjprescott or @yugangw-msft I can use some help trying to figure out why this is failing on CloudShell for a few customers. The parameters the az web app up command defines
https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_params.py#L363-L369
However, looking at the --debug error shared here '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.()]+$'),'
which makes me believe that cloud shell is expecting a value for resource_group_name that doesn't exist for this command. Any ideas? This might be fixed once we support this https://github.com/Azure/azure-cli/issues/9132 - however for now, this error on CloudShell is confusing.
After more research here found this work around for cloud Shell @jofroe & @sumgro can you both try to log in to your CloudShell again. CloudShell should auto log you in - but there is something weird happening that is messing with the username provided, that while trying to use the username as the suffix for the default RG name - we see the error message.
From your cloudShell run az login -> follow the instructions & re-login with the same account & now follow the instructions to run the az webapp up command as before. Please let me know if this resolves the issue.
thanks @panchagnula and it worked finally for me. I have stucked in here and I tried your last solution az login. It worked perfectly with the cloud shell. Thanks!
Most helpful comment
So after a frustrating week with Azure, I figured out that my issue was actually with their docs.
There's a step that says "click shell", then no explanation of what happens shortly after which is you are prompted to choose a storage option / sign up to a subscription.
This creates a resource group name by itself: cloud-shell-storage-
If you continue following the OFFICIAL DOCS, it says to enter "az webapp up -n". It doesn't say anything about linking your webapp to the automatically generated resource group. So I think the app is trying to find one that doesn't exist, and fails.
I solved the issue by using AWS instead.
EDIT:
If you're stuck with using Azure, after you select storage, check the "resource groups" tab and use the resource name given there in the steps that follow.