Skip to content

Commit

Permalink
Update migration-from-v3-to-v4.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyZhou committed Feb 20, 2024
1 parent cc04129 commit 1e98f82
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/migration-from-v3-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,28 @@ For model cmdlet, a parameter is required only if it is marked as required, both
### How to mitigate the breaking changes of x-ms-mutability

There is no mitigation since it is actually a fix for existing issues.

## None-fixed array

In v3, if a response contained a property with an array type, it was generated as a fixed-size C# array that couldn't support adding new elements through functions like Add. In v4, we generate a list instead of an array to support the Add function in such cases.

### How to mitigate the breaking changes of non-fixed array

This is a design change and we do not provide a way to generate fixed array anymore. From users' perspective, the following modifications should be made in scripts that utilize PowerShell modules generated with v4:

- Use Count instead of Length to retrieve the number of elements
- Use the ToArray function if conversion to a fixed-size array is needed

## Managed Identity Best Practice Alignment

In v3, IdentityType and UserAssignedIdentity are generated and totally matches with swagger definition. In v4, we generate them to align our best practice design. As a result, generated cmdlets will have changes as below.

- For IdentityType, it will be changed to EnableSystemAssignedIdentity\<SwitchParameter\> for new-* cmdlet and EnableSystemAssignedIdentity\<bool\> for update-* cmdlet.
- For UserAssignedIdentity, it will be changed from UserAssignedIdentity\<HashTable\> to UserAssignedIdentity\<string\[\]\>.


### How to mitigate the breaking changes of Managed Identity Best Practice Alignment

It's recommended to migrate to best practice design for managed identity features. To avoid breaking changes in regular release,
- For IdentityType, configure `disable-transform-identity-type` as `true` in README.md.
- For UserAssignedIdentity, configure `flatten-userassignedidentity` as `false` in README.md.

0 comments on commit 1e98f82

Please sign in to comment.