APIVersion 2021-04-01 not available in Python3.8 and az cli 2.24.2
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
## Describe the bug
az storage account network-rule add fails with `NotImplementedError: APIVersion 2021-04-01 is not available`
**Command Name**
`az storage account network-rule add`
**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 "/usr/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
raise ex
File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
result = cmd_copy(params)
File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
return self.handler(*args, **kwargs)
File "/usr/lib/python3.8/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 "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/_client_factory.py", line 143, in cf_sa
return storage_client_factory(cli_ctx).storage_accounts
File "/usr/lib/python3.8/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.
- install az cli 2.24.x in a python 3.8 environment
- `az storage account network-rule add --resource-group {} --account-name {} --ip-address {}`
## Expected Behavior
Network rule add should work for given storage account.
## Environment Summary
```
Linux-5.10.25-linuxkit-x86_64-with
Python 3.8.10
Installer: PIP
azure-cli 2.24.2 *
Extensions:
ml 2.0.1a3
```
## Additional Context
Contributor guide
Assessment
This issue has not been assessed yet.