az storage container create returns no error
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
## Describe the bug
There are the following problems with the `az storage container` commands like `create` or `delete`:
1. If they fail the return code is zero
2. There is no error message returned but only a JSON with created/deleted set to false (see below).
**Command Name**
`az storage container create --auth-mode login --account-name $storage_account_name -n mycontainer`
**Errors:**
```
{
"created": false
}
```
## To Reproduce:
```bash
storage_account_name=satest1234
az group create -n sa-test -l westeurope
az storage account create -g sa-test -n $storage_account_name --allow-blob-public-access false --min-tls-version TLS1_2
az storage container create --auth-mode login --account-name $storage_account_name -n mycontainer
# expect error with an error message that container already exists
az storage container create --auth-mode login --account-name $storage_account_name -n mycontainer
# expected non zero exit code
echo $?
```
## Expected Behavior
* The commands should return a error message if they fail.
* The return code of az should be non zero if the action fails.
## Environment Summary
```
Python 3.10.10
Installer: DEB
azure-cli 2.46.0
```
## Additional Context
Contributor guide
Assessment
This issue has not been assessed yet.