Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

az storage account show-connection-string does not work #17588

Open nkadochn opened 3 years ago

nkadochn commented 3 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az storage account show-connection-string

Errors:

APIVersion 2021-01-01 is not available
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 233, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 660, in execute
    raise ex
cli/core/commands/__init__.py, ln 723, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 716, in _run_job
    six.reraise(*sys.exc_info())
...
cli/command_modules/storage/_client_factory.py, ln 143, in cf_sa
    return storage_client_factory(cli_ctx).storage_accounts
azure/mgmt/storage/_storage_management_client.py, ln 413, in storage_accounts
    raise NotImplementedError("APIVersion {} is not available".format(api_version))
NotImplementedError: APIVersion 2021-01-01 is not available

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Linux-4.15.0-1108-azure-x86_64-with-debian-stretch-sid
Python 3.6.9
Installer: PIP

azure-cli 2.20.0 *
azure-cli-ml 1.24.0

Extensions:
azure-cli-ml 1.24.0

Additional Context

yonzhan commented 3 years ago

storage

Juliehzl commented 3 years ago

@nkadochn May I know which cloud you are using?

nkadochn commented 3 years ago

I am executing within ml.azure.com

Juliehzl commented 3 years ago

I am executing within ml.azure.com

Do you know allowed api version list for storage in ml.azure.com? If you only want to use basic features, you could set to 2020-09-01-hybrid profile and use old api version 2019-06-01 with az cloud set --profile 2020-09-01-hybrid.

nkadochn commented 3 years ago

I expect Azure cloud commands to work from Azure ML.

azureuser@standard-4c-16m-100gb:/mnt/batch/tasks/shared/LS_root/mounts/clusters/standard-4c-16m-100gb/code$ az storage account list The command failed with an unexpected error. Here is the traceback: APIVersion 2021-01-01 is not available Traceback (most recent call last): File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 660, in execute raise ex File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 723, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 716, in _run_job six.reraise(sys.exc_info()) File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/six.py", line 703, in reraise raise value File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 694, in _run_job result = cmd_copy(params) File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 331, in call return self.handler(args, **kwargs) File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/init.py", line 799, in default_command_handler client = client_factory(cmd.cli_ctx, command_args) if client_factory else None File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/command_modules/storage/_client_factory.py", line 143, in cf_sa return storage_client_factory(cli_ctx).storage_accounts File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/mgmt/storage/_storage_management_client.py", line 413, in storage_accounts raise NotImplementedError("APIVersion {} is not available".format(api_version)) NotImplementedError: APIVersion 2021-01-01 is not available

Juliehzl commented 3 years ago

In Azure Public Cloud and production Azure CLI, we do support 2021-01-01 api version. But for Azure ML, it seems not and Azure ML is in azure-cli-ml extension, which source code is owned by @j-so team.
@j-so could you check azure-cli-ml extension for the issue?

nkadochn commented 3 years ago

Why was this issue closed? The functionality clearly has not been fixed

yonzhan commented 3 years ago

@nkadochn Since for Azure ML, the source code is in azure-cli-ml extension, which is owned by @j-so team. We are pending on @j-so for the update. We could reopen this issue.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
### **This is autogenerated. Please review and update as needed.** ## Describe the bug **Command Name** `az storage account show-connection-string` **Errors:** ``` APIVersion 2021-01-01 is not available Traceback (most recent call last): python3.6/site-packages/knack/cli.py, ln 233, in invoke cmd_result = self.invocation.execute(args) cli/core/commands/__init__.py, ln 660, in execute raise ex cli/core/commands/__init__.py, ln 723, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) cli/core/commands/__init__.py, ln 716, in _run_job six.reraise(*sys.exc_info()) ... cli/command_modules/storage/_client_factory.py, ln 143, in cf_sa return storage_client_factory(cli_ctx).storage_accounts azure/mgmt/storage/_storage_management_client.py, ln 413, in storage_accounts raise NotImplementedError("APIVersion {} is not available".format(api_version)) NotImplementedError: APIVersion 2021-01-01 is not available ``` ## To Reproduce: Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information. - _Put any pre-requisite steps here..._ - `az storage account show-connection-string -g {} -n {}` ## Expected Behavior ## Environment Summary ``` Linux-4.15.0-1108-azure-x86_64-with-debian-stretch-sid Python 3.6.9 Installer: PIP azure-cli 2.20.0 * azure-cli-ml 1.24.0 Extensions: azure-cli-ml 1.24.0 ``` ## Additional Context
Author: nkadochn
Assignees: Juliehzl
Labels: `Extensions`, `OKR3.2 Candidate`, `Service Attention`, `Storage`, `customer-response-expected`, `feature-request`
Milestone: Backlog
j-so commented 3 years ago

This is not related to the azure-cli-ml extension. It seems like this command is being run through the AzureML compute instance terminal experience. Is that correct @nkadochn ?

nkadochn commented 3 years ago

That is correct

j-so commented 3 years ago

@nkadochn I have forwarded this issue to the appropriate team, and they are tracking it.

In the meantime, you could try using az version 2.19.1. This seems to be an issue only with az version >=2.20.0.