Skip to content

az storage container create returns no error #25868

@dvob

Description

@dvob

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:

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions