You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/development-docs/design-guidelines/managed-identity-best-practices.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,3 +58,32 @@ We are recommended to use string array as the type of UserAssignedIdentity with
58
58
- No syntax changes if service supports one more user assigned identity in future;
59
59
- Service will provide correct error response if customer reaches the count limitation of `UserAssignedIdentity` ideally, which means no harm.
60
60
61
+
### How to disable transforming IdentityType and UserAssignedIdentity to avoid breaking changes when migrate from autorest.powershell v3 to v4.
62
+
See details at [here](https://github.com/Azure/autorest.powershell/blob/main/docs/migration-from-v3-to-v4.md#how-to-mitigate-the-breaking-changes-of-managed-identity-best-practice-alignment).
63
+
64
+
### What should I do to mitigate one patch operation which is reported to parameter IdentityType can not be transformed as the best practice design?
65
+
66
+
autorest.powershell is unable to transform IdentityType as the best practice design for certain reasons. To mitigate this issue,
67
+
- 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.
68
+
- disable transformation for the operation which reported error in README.md by
69
+
```
70
+
disable-transform-identity-type-for-operation
71
+
- Operation_id
72
+
```
73
+
- hide the corresponding Update cmdlet in directive by
74
+
```
75
+
- where:
76
+
verb: Update
77
+
subject: {Subject-Name}
78
+
hide: true
79
+
```
80
+
- run `autorest` and `./build-module.ps1`
81
+
- manually change IdentityType to EnableSystemAssignedIdentity<bool> in `Update-Az{ModuleName}{Subject-Name}` like
# Decides if enable a system assigned identity for the resource.
87
+
${EnableSystemAssignedIdentity},
88
+
```
89
+
- calculate the value of IdentityType as swagger defined in process block, see [instance](https://github.com/Azure/azure-powershell/blob/827001c79c4416e0b74f5857c2ad72b7932b1f9a/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1#L269) for Update-Az{ModuleName}{Subject-Name}.
0 commit comments