Azure / Azure/azure-cli-extensions

az hack fails to create an app if any free app service plan in a different location already exists

Open
#1,329 1 comment 0 reactions 0 assignees View on GitHub
extension/hack Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

- If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at [Azure/azure-cli](https://github.com/Azure/azure-cli/issues)

### Extension name (the extension in question)
`hack`

### Description of issue (in as much detail as possible)
When executing the following command:
```
az hack create --name signdemo --runtime python --ai --location westus2 --output yaml
```
I got the following exception:
```
Creating website...
The command failed with an unexpected error. Here is the traceback:


update_site_config() takes 2 positional arguments but 3 were given
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 608, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 666, 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 659, in _run_job
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 636, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 306, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 493, in default_command_handler
return op(**command_args)
File "/home/michimune/.azure/cliextensions/hack/azext_hack/custom.py", line 40, in create_hack
website.create()
File "/home/michimune/.azure/cliextensions/hack/azext_hack/_website_utils.py", line 67, in create
webapp = self.__create_webapp(app_service_plan)
File "/home/michimune/.azure/cliextensions/hack/azext_hack/_website_utils.py", line 144, in __create_webapp
plan=app_service_plan.name, runtime=runtime_setting['name'], deployment_local_git=True)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 135, in create_webapp
match['setter'](cmd, match, site_config)
TypeError: update_site_config() takes 2 positional arguments but 3 were given
```

I investigated and found that if there is any free app service plan in a different region exists, this error occurs. If I specify the same region as the existing plan then the command works.
-----

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.