Skip to content

az bot create is not idempotent #11697

Description

@maxnorth

Describe the bug
Calling 'az bot create' a second time returns an error instead of just returning the existing resource.

To Reproduce

  1. Call az bot create -n examplename -g examplegroup -k registration <...etc> once. Request will succeed with newly created resource with the specified name in the specified resource group. No trouble so far.
  2. Call az bot create a second time with the exact same arguments as in step 1. The request will fail with a message Unable to create a bot with a name of "examplename". Reason: The requested bot name is not available

Expected behavior
Like other 'create' commands in the Azure CLI, I would expect this request to succeed the second time and simply return the json for the existing resource instead of trying to create a new one.

Environment summary
OS is Windows 10 Enterprise 1909
Installed via MSI installer
Versions:
azure-cli - 2.0.78

command-modules-nspkg - 2.0.3
core - 2.0.78
nspkg - 3.0.4
telemetry - 1.0.4

Extensions:
application-insights - 0.1.1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory '~.azure\cliextensions'

Additional context
N/A

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions