Azure / Azure/azure-cli

"az storage account network-rule list" not available in version 2.24.0 on AML compute instance.

Open
#20,571 2 comments 0 reactions 1 assignee Claimed by @evelyn-ys View on GitHub
act-codegen-extensibility-squad feature-request Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

The documented command "az storage account network-rule list" returns an error:
APIVersion 2021-04-01 is not available

when run on an AML compute instance running azure-cli 2.24.0.

The command is documented in https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli?toc=%2Fcli%2Fazure%2Ftoc.json&bc=%2Fcli%2Fazure%2Fbreadcrumb%2Ftoc.json&view=azure-cli-latest

for version 2.30.0.

The release notes mention that az storage account network-rule: GA resource access rules were released 2 March 2021 for version 2.20.0, so the compute instance version should be adequate.

The actual desired usage is to enable and disable a storage account network rule set programmatically.

**Command Name**
`az storage account network-rule list`

**Errors:**
```
The command failed with an unexpected error. Here is the traceback:
APIVersion 2021-04-01 is not available
Traceback (most recent call last):
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/knack/cli.py", line 231, 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 657, in execute
raise ex
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, 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 691, in _run_job
result = cmd_copy(params)
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
return self.handler(*args, **kwargs)
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
client = self.client_factory(self.cli_ctx, command_args) if self.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-04-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 network-rule list --account-name {} --resource-group {}`

## Expected Behavior

## Environment Summary
```
Linux-5.4.0-1056-azure-x86_64-with-debian-buster-sid
Python 3.6.9
Installer: PIP

azure-cli 2.24.0 *
azure-cli-ml 1.33.0

Extensions:
azure-cli-ml 1.33.0

```
## Additional Context

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.