Azure / azure-cli

Azure Command-Line Interface
MIT License
3.94k stars 2.92k forks source link

az ad group member add is not idempotent #16905

Open riezebosch opened 3 years ago

riezebosch commented 3 years ago

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

Describe the bug I'm running this command from an Azure DevOps pipeline as part of our infrastructure deployment and without additional care these commands fail for subsequent runs.

To Reproduce az ad group member add -g $rg --member-identity $id az ad group member add -g $rg --member-identity $id

One or more added object references already exist for the following modified properties: 'members'.

Expected behavior No error.

Environment summary

azure-cli                         2.19.1

core                              2.19.1
telemetry                          1.0.6

Extensions:
datafactory                        0.2.0
azure-devops                      0.18.0
resource-graph                     1.1.0
application-insights               0.1.5
image-copy-extension               0.0.7

Additional context I've run the same command on ubuntu, macOs and Windows. Here's my workaround: https://twitter.com/MRiezebosch/status/1359533376777179137

yonzhan commented 3 years ago

Graph

TWolversonReply commented 1 year ago

Also encountering this problem. This is at odds with how almost everything else in Azure works; commands should be idempotent.