Skip to content

Commit

Permalink
replace managed user assigned identity instead of appending (#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyZhou committed Apr 10, 2024
1 parent 8949281 commit f6c2148
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion powershell/cmdlets/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,9 @@ export class CmdletClass extends Class {
return If('this.UserAssignedIdentity?.Length > 0',
function* () {
yield '// calculate UserAssignedIdentity';
yield ForEach('id', 'this.UserAssignedIdentity', `${$this.bodyParameter?.value}.${$this.GetUserAssignedIdentityPropertyName()}.Add(id, new ${$this.GetUserAssignedIdentityParameterElementType()}());`);
const userAssignedIdentityPropertyName = $this.GetUserAssignedIdentityPropertyName();
yield `${$this.bodyParameter?.value}.${userAssignedIdentityPropertyName}.Clear();`;
yield ForEach('id', 'this.UserAssignedIdentity', `${$this.bodyParameter?.value}.${userAssignedIdentityPropertyName}.Add(id, new ${$this.GetUserAssignedIdentityParameterElementType()}());`);
yield '';
}
);
Expand Down

0 comments on commit f6c2148

Please sign in to comment.