Azure / Azure/azure-cli

az storage account check-name --name not setting exit code for existing

Open
#19,346 1 comment 0 reactions 1 assignee Assigned to @evelyn-ys View on GitHub
act-codegen-extensibility-squad customer-reported feature-request Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**
Running `az storage account check-name --name` does not set an error if the storage account name already exists.

**To Reproduce**
1) Create a storage account
2) check if it exists:
`az storage account check-name --name existing`
3) Check the exit code
`$LASTEXITCODE`

**Expected behavior**
Since the storage account names have to be different, it should switch the exit code to 1, instead of 0.

**Environment summary**
`PS C:\Users\tayven.bigelow> $PSVersionTable
PSVersion 7.1.3
PSEdition Core`

`PS C:\Users\tayven.bigelow> az --version
azure-cli 2.27.2
core 2.27.2
telemetry 1.0.6
Extensions:
account 0.2.1
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\tayven.bigelow\.azure\cliextensions'
Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]`

**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.