Skip to content

Commit

Permalink
Update managed-identity-best-practices.md (#26351)
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyZhou authored Oct 17, 2024
1 parent 2bbfd5b commit fc9eee8
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ We are recommended to use string array as the type of UserAssignedIdentity with
- No syntax changes if service supports one more user assigned identity in future;
- Service will provide correct error response if customer reaches the count limitation of `UserAssignedIdentity` ideally, which means no harm.

### How to disable transforming IdentityType and UserAssignedIdentity to avoid breaking changes when migrate from autorest.powershell v3 to v4.
See details at [here](https:/Azure/autorest.powershell/blob/main/docs/migration-from-v3-to-v4.md#how-to-mitigate-the-breaking-changes-of-managed-identity-best-practice-alignment).
### What should I do if transforming IdentityType and UserAssignedIdentity introduce breaking changes
This breaking changes usually happen when migrate from autorest.powershell v3 to v4. In general, we require APIs that support managed identity to follow the standard pattern described in this guide. So please follow these steps:
If the module is under pre-GA status, we can let the syntax break directly due to pre-GA features are not promised stable.
If the module is GAed, we need to disable the transform (See guideline at [here](https:/Azure/autorest.powershell/blob/main/docs/migration-from-v3-to-v4.md#how-to-mitigate-the-breaking-changes-of-managed-identity-best-practice-alignment).) but preannounce breaking change) and plan to break it (add upcoming breaking changes for them and take the effects on a major release).

### What should I do to mitigate one patch operation which is reported to parameter IdentityType can not be transformed as the best practice design?
### What should I do if Autorest reports _"Parameter IdentityType in operation '{operationId}' can not be transformed as the best practice design"_?
This error indicates that autorest is trying to replace PATCH operation by GET+PUT operation to let IdentityType transformed as best practice desgin but failed due to certain reasons. One of common reasons is GET operation contains query parameter and autorest has not supported such a combined GET+PUT operation. To mitigate this issue,

autorest.powershell is unable to transform IdentityType as the best practice design for certain reasons. To mitigate this issue,
- Include a customization script to transform the parameter IdentityType to EnableSystemAssignedIdentity by `get` + `patch` update for this type of operation. The following are the detailed steps on how to accomplish this.
- disable transformation for the operation which reported error in README.md by
```
Expand Down

0 comments on commit fc9eee8

Please sign in to comment.