Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
384 stars 1.25k forks source link

az hack failure creating App Service plan #1245

Open dnj55 opened 4 years ago

dnj55 commented 4 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Running az hack as details below resulting in the following successful output: Creating resource group... Starting creation of Cognitive Services keys... Starting website creation job...

Hack then fail on the next step: Creating free App Service plan named free_app_service_plan...

Command Name az hack create Extension Name: hack. Version: 0.3.0.

Errors:

Unable to get API version for type 'None' in profile 'latest'
Traceback (most recent call last):
cli\core\profiles\_shared.py, ln 296, in get_api_version
KeyError: None

...

cli\core\profiles\_shared.py, ln 469, in get_versioned_sdk_path
cli\core\profiles\_shared.py, ln 303, in get_api_version
azure.cli.core.profiles._shared.APIVersionException: Unable to get API version for type 'None' in profile 'latest'

To Reproduce:

Preceding steps were:

Expected Behavior

Expected hack to create specified resources in Azure.

Environment Summary

Windows-10-10.0.17763-SP0
Python 3.6.6
Shell: cmd.exe

azure-cli 2.0.81

Extensions:
hack 0.3.0

Additional Context

az hack failed in this same way for all students attending 2/4/20 Microsoft New York Reactor AI presentation. All students were following the steps laid out on this page from the Reactors GitHub repo: https://github.com/microsoft/Reactors/blob/master/AI_1/computer-vision-translator/create-computer-vision-keys.md

arrownj commented 4 years ago

@dnj55 , thanks for reporting, we are looking at it.

arrownj commented 4 years ago

Hi @GeekTrainer , could you please hele take a look at this ?

GeekTrainer commented 4 years ago

@dnj55 - Thanks for reporting this! Please upgrade to the current version and it'll resolve your problem

GeekTrainer commented 4 years ago

@arrownj Please feel free to close

michimune commented 4 years ago

Hi, I am having the exact same issue on Azure Cloud Shell. The extension's version is 0.4.1, which is the latest. The stack trace seems a bit different, though:

Unable to get API version for type 'None' in profile 'latest'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/profiles/_shared.py", line 297, in get_api_version
    api_version = AZURE_API_PROFILES[api_profile][resource_type]
KeyError: None

During handling of the above exception, another exception occurred:

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 60, in create
    app_service_plan = self.__get_or_create_app_service_plan()
  File "/home/michimune/.azure/cliextensions/hack/azext_hack/_website_utils.py", line 126, in __get_or_create_app_service_plan
    name=default_free_plan_name, is_linux=True, hyper_v=False).result()
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 1389, in create_app_service_plan
    'HostingEnvironmentProfile', 'SkuDescription', 'AppServicePlan')
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 330, in get_models
    operation_group=operation_group)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 436, in get_sdk
    *attr_args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/profiles/__init__.py", line 90, in get_sdk
    return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/profiles/_shared.py", line 484, in get_versioned_sdk
    sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/profiles/_shared.py", line 470, in get_versioned_sdk_path
    api_version = get_api_version(api_profile, resource_type)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/profiles/_shared.py", line 304, in get_api_version
    raise APIVersionException(resource_type, api_profile)
azure.cli.core.profiles._shared.APIVersionException: Unable to get API version for type 'None' in profile 'latest'
GeekTrainer commented 4 years ago

1309 resolves this issue. Just waiting for it to be merged.