identity update/delete --ids can leave work half done

Aperta Adatta ai principianti
#1,512 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, powershell
Ambito
cli

Direzione di ricerca

Inizia dai gestori dei comandi di aggiornamento ed eliminazione delle identità, che scorrono i valori di --ids, dove ogni ID viene validato e gestito a turno. Ristruttura in modo che ogni ID venga validato prima che venga inviata qualsiasi richiesta, e conferma che un ID malformato come /subscriptions/x/bad produce l'errore 'Invalid managed identity resource id' senza eliminare o aggiornare nulla. Viene menzionata anche l'interfaccia PowerShell, che va verificata per lo stesso comportamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

act-identity-squad bug
Affected surface

CLI (az)

Describe the bug
Command

az identity delete --ids
az identity update --ids

Check if PS is affected too

Problem

--ids lets you act on several identities in one command. The CLI handles them one at a time: check ID 1, act on it, check ID 2, act on it, and so on. It only notices a bad ID when it reaches it. So if the second ID is malformed, the first identity has already been deleted or changed, and then the command stops with an error. You end up with some done and some not, and the error doesn't tell you what already happened.

It should check every ID first, and only then act on any of them.

Steps to reproduce

az identity delete --ids /subscriptions/x/bad

Errors & debug output

Expected behavior

Expected: "Invalid managed identity resource id", and nothing deleted/updated.
Actual: the first identity is deleted/updated , then the error appears.

Fix

check all the IDs before the loop, then send the requests.

Environment

Additional context

No response

Lingua principale
C#
Stelle
18
Fork
10
Merge medio
1g 20h
PR unite (30g)
157

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/azclips

Tutte le issue di Azure/azclips

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.