Closed asote closed 6 years ago
@asote Thanks for the feedback! We are currently investigating and will update you shortly.
Hey @asote - This appears to be related to the way Azure CLI
parses variable values under the context of shell scripts run in CloudShell - hence the regex error from Python. As such, could you open an issue on Azure CLI repo?
Moreover, since there isn't anything broken with the sample script on this documentation, we will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.
Oh right,
This appears to be related to the way Azure CLI parses variable values under the context of shell scripts run in CloudShell
Well at least that solves the problem.
rolls_eyes_blows_brains_out.gif
I grabbed the sample script above and uploaded it to my cloud drive in Azure Cloud Shell as webappdeployment.sh When I run the script from Azure Cloud Shell myusername@Azure:~/clouddrive/quickstart$ bash webappdeployment.sh
I get an error when trying to create resource group name.
Command: az group create --location centralus --name myResourceGroup
Error: Parameter 'resource_groupname' must conform to the following pattern: '^[-\w\.\(\)]+$'. Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 197, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 337, in execute six.reraise(sys.exc_info()) File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise raise value File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 311, in execute result = cmd(params) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 171, in call return super(AzCliCommand, self).call(args, *kwargs) File "/opt/az/lib/python3.6/site-packages/knack/commands.py", line 109, in call return self.handler(args, kwargs) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py", line 421, in default_command_handler result = op(command_args) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/resource/custom.py", line 452, in create_resource_group return rcf.resource_groups.create_or_update(rg_name, parameters) File "/opt/az/lib/python3.6/site-packages/azure/mgmt/resource/resources/v2017_05_10/operations/resource_groups_operations.py", line 123, in create_or_update 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, minlength=1, pattern=r'^[-\w.()]+$'), File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 579, in url data = self.validate(data, name, required=True, **kwargs) File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 659, in validate raise ValidationError(key, name, value) msrest.exceptions.ValidationError: Parameter 'resource_groupname' must conform to the following pattern: '^[-\w\.\(\)]+$'.
The command works fine if I execute it manually.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.