Skip to content

Commit 92c7bcf

Browse files
authored
[PS] Migrate ManagedServiceIdentity module to autorest v4 (#27350)
1 parent 06fe1b0 commit 92c7bcf

31 files changed

+481
-148
lines changed

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ generated
55
internal
66
exports
77
tools
8-
custom/autogen-model-cmdlets
98
test/*-TestResults.xml
109
license.txt
1110
/*.ps1

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
2121
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
2222
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ManagedServiceIdentityClient")]
23-
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0")]
24-
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.1")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.1")]
2525
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
2626
[assembly: System.CLSCompliantAttribute(false)]

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/README.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,19 @@ input-file:
3535
- $(repo)/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2022-01-31-preview/ManagedIdentity.json
3636

3737
subject-prefix: ""
38-
resourcegroup-append: true
39-
nested-object-to-string: true
40-
identity-correction-for-post: true
4138
module-version: 0.3.0
4239

43-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
44-
use-extension:
45-
"@autorest/powershell": "3.x"
46-
4740
directive:
41+
# Update Location parameter available
42+
- from: swagger-document
43+
where: $.definitions.IdentityUpdate.properties.location.x-ms-mutability
44+
transform: >-
45+
return [
46+
"read",
47+
"update",
48+
"create"
49+
]
50+
4851
- where:
4952
verb: Set
5053
subject: SystemAssignedIdentity|UserAssignedIdentity
@@ -58,7 +61,11 @@ directive:
5861

5962
- where:
6063
subject: UserAssignedIdentity
61-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
64+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
65+
remove: true
66+
- where:
67+
subject: UserAssignedIdentity
68+
variant: ^CreateViaIdentity.*$
6269
remove: true
6370

6471
- where:
@@ -113,7 +120,12 @@ directive:
113120

114121
- where:
115122
subject: FederatedIdentityCredential
116-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
123+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
124+
remove: true
125+
126+
- where:
127+
subject: FederatedIdentityCredential
128+
variant: ^CreateViaIdentity.*$|^GetViaIdentityUserAssignedIdentity$|^DeleteViaIdentityUserAssignedIdentity$|^UpdateViaIdentityUserAssignedIdentityExpanded$
117129
remove: true
118130

119131
- where:
@@ -152,18 +164,18 @@ directive:
152164

153165
- where:
154166
subject: FederatedIdentityCredential
155-
variant: ^Get1$|^List1$|^GetViaIdentity1$|^Create1$|^CreateExpanded1$|^CreateViaIdentity1$|^CreateViaIdentityExpanded1$|^Delete1$|^DeleteViaIdentity1$|^Update1$|^UpdateExpanded1$|^UpdateViaIdentity1$|^UpdateViaIdentityExpanded1$
167+
variant: ^Get1$|^List1$|^GetViaIdentity1$|^GetViaIdentityUserAssignedIdentity1$|^Create1$|^CreateExpanded1$|^CreateViaIdentity1$|^CreateViaIdentityExpanded1$|^CreateViaIdentityUserAssignedIdentity1$|^CreateViaIdentityUserAssignedIdentityExpanded1$|^CreateViaJsonFilePath1$|^CreateViaJsonString1$|^Delete1$|^DeleteViaIdentity1$|^DeleteViaIdentityUserAssignedIdentity1$|^Update1$|^UpdateExpanded1$|^UpdateViaIdentity1$|^UpdateViaIdentityExpanded1$|^UpdateViaIdentityUserAssignedIdentityExpanded1$|^UpdateViaIdentityUserAssignedIdentity1$|^UpdateViaJsonFilePath1$|^UpdateViaJsonString1$
156168
remove: true
157169

158170
- where:
159171
verb: Get
160172
subject: SystemAssignedIdentity
161-
variant: ^Get1$|^GetViaIdentity1$
173+
variant: ^Get1$ #|^GetViaIdentity1$
162174
remove: true
163175

164176
- where:
165177
subject: UserAssignedIdentity
166-
variant: ^Get1$|^GetViaIdentity1$|^List2$|^List3$|^Create1$|^CreateExpanded1$|^CreateViaIdentity1$|^CreateViaIdentityExpanded1$|^Delete1$|^DeleteViaIdentity1$|^Update1$|^UpdateExpanded1$|^UpdateViaIdentity1$|^UpdateViaIdentityExpanded1$
178+
variant: ^Get1$|^GetViaIdentity1$|^List2$|^List3$|^Create1$|^CreateExpanded1$|^CreateViaIdentity1$|^CreateViaIdentityExpanded1$|^CreateViaJsonFilePath1$|^CreateViaJsonString1$|^Delete1$|^DeleteViaIdentity1$|^Update1$|^UpdateExpanded1$|^UpdateViaIdentity1$|^UpdateViaIdentityExpanded1$|^UpdateViaJsonFilePath1$|^UpdateViaJsonString1$
167179
remove: true
168180

169181
# END
@@ -195,29 +207,4 @@ directive:
195207
- Name
196208
- Location
197209
- ResourceGroupName
198-
199-
#breaking change message
200-
- where:
201-
parameter-name: Audience
202-
set:
203-
breaking-change:
204-
old-parameter-type: System.String[]
205-
new-parameter-type: System.Collections.Generic.List`1[System.String]
206-
change-description: "The type of property 'Audience' of type 'FederatedIdentityCredential' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'."
207-
deprecated-by-version: 2.0.0
208-
deprecated-by-azversion: 14.0.0
209-
change-effective-date: 2025/05/19
210-
211-
- where:
212-
subject: FederatedIdentityCredential
213-
set:
214-
breaking-change:
215-
deprecated-output-properties:
216-
- Audience <System.String[]>
217-
new-output-properties:
218-
- Audience <System.Collections.Generic.List`1[System.String]>
219-
change-description: "The type of property 'Audience' of type 'FederatedIdentityCredential' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'."
220-
deprecated-by-version: 2.0.0
221-
deprecated-by-azversion: 14.0.0
222-
change-effective-date: 2025/05/19
223210
```

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/custom/AzureResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.Api20220131Preview
1+
namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models
22
{
33
/// <summary>Customizations of AzureResource</summary>
44
public partial class AzureResource

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/docs/Az.ManagedServiceIdentity.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.ManagedServiceIdentity
3-
Module Guid: 07ea637c-d665-40b4-9ced-fc0bdd913dde
3+
Module Guid: ac255d9f-3244-436f-8ee5-2eb25b96fce9
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.managedserviceidentity
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -24,10 +24,10 @@ Gets the identity.
2424
Lists the associated resources for this identity.
2525

2626
### [New-AzFederatedIdentityCredential](New-AzFederatedIdentityCredential.md)
27-
Create or update a federated identity credential under the specified user assigned identity.
27+
create a federated identity credential under the specified user assigned identity.
2828

2929
### [New-AzUserAssignedIdentity](New-AzUserAssignedIdentity.md)
30-
Create or update an identity in the specified subscription and resource group.
30+
create an identity in the specified subscription and resource group.
3131

3232
### [Remove-AzFederatedIdentityCredential](Remove-AzFederatedIdentityCredential.md)
3333
Deletes the federated identity credential.
@@ -36,8 +36,8 @@ Deletes the federated identity credential.
3636
Deletes the identity.
3737

3838
### [Update-AzFederatedIdentityCredential](Update-AzFederatedIdentityCredential.md)
39-
Create or update a federated identity credential under the specified user assigned identity.
39+
update a federated identity credential under the specified user assigned identity.
4040

4141
### [Update-AzUserAssignedIdentity](Update-AzUserAssignedIdentity.md)
42-
Update an identity in the specified subscription and resource group.
42+
update an identity in the specified subscription and resource group.
4343

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/docs/Get-AzFederatedIdentityCredential.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ Accept wildcard characters: False
113113
114114
### -InputObject
115115
Identity Parameter
116-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
117116
118117
```yaml
119118
Type: Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.IManagedServiceIdentity
@@ -213,7 +212,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
213212
214213
## OUTPUTS
215214
216-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.Api20230131.IFederatedIdentityCredential
215+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.IFederatedIdentityCredential
217216
218217
## NOTES
219218

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/docs/Get-AzSystemAssignedIdentity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
7575
7676
## OUTPUTS
7777
78-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.Api20230131.ISystemAssignedIdentity
78+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.ISystemAssignedIdentity
7979
8080
## NOTES
8181

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/docs/Get-AzUserAssignedIdentity.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ Accept wildcard characters: False
115115
116116
### -InputObject
117117
Identity Parameter
118-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
119118
120119
```yaml
121120
Type: Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.IManagedServiceIdentity
@@ -183,7 +182,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
183182
184183
## OUTPUTS
185184
186-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.Api20230131.IIdentity
185+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.IIdentity
187186
188187
## NOTES
189188

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/docs/Get-AzUserAssignedIdentityAssociatedResource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
228228
229229
## OUTPUTS
230230
231-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.Api20220131Preview.IAzureResource
231+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.IAzureResource
232232
233233
## NOTES
234234

src/ManagedServiceIdentity/ManagedServiceIdentity.Autorest/docs/New-AzFederatedIdentityCredential.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,33 @@ schema: 2.0.0
88
# New-AzFederatedIdentityCredential
99

1010
## SYNOPSIS
11-
Create or update a federated identity credential under the specified user assigned identity.
11+
create a federated identity credential under the specified user assigned identity.
1212

1313
## SYNTAX
1414

15+
### CreateExpanded (Default)
1516
```
1617
New-AzFederatedIdentityCredential -IdentityName <String> -Name <String> -ResourceGroupName <String>
1718
[-SubscriptionId <String>] [-Audience <String[]>] [-Issuer <String>] [-Subject <String>]
1819
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
1920
```
2021

22+
### CreateViaJsonFilePath
23+
```
24+
New-AzFederatedIdentityCredential -IdentityName <String> -Name <String> -ResourceGroupName <String>
25+
-JsonFilePath <String> [-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
26+
[<CommonParameters>]
27+
```
28+
29+
### CreateViaJsonString
30+
```
31+
New-AzFederatedIdentityCredential -IdentityName <String> -Name <String> -ResourceGroupName <String>
32+
-JsonString <String> [-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
33+
[<CommonParameters>]
34+
```
35+
2136
## DESCRIPTION
22-
Create or update a federated identity credential under the specified user assigned identity.
37+
create a federated identity credential under the specified user assigned identity.
2338

2439
## EXAMPLES
2540

@@ -59,7 +74,7 @@ The list of audiences that can appear in the issued token.
5974

6075
```yaml
6176
Type: System.String[]
62-
Parameter Sets: (All)
77+
Parameter Sets: CreateExpanded
6378
Aliases:
6479

6580
Required: False
@@ -105,7 +120,7 @@ The URL of the issuer to be trusted.
105120
106121
```yaml
107122
Type: System.String
108-
Parameter Sets: (All)
123+
Parameter Sets: CreateExpanded
109124
Aliases:
110125

111126
Required: False
@@ -115,6 +130,36 @@ Accept pipeline input: False
115130
Accept wildcard characters: False
116131
```
117132
133+
### -JsonFilePath
134+
Path of Json file supplied to the Create operation
135+
136+
```yaml
137+
Type: System.String
138+
Parameter Sets: CreateViaJsonFilePath
139+
Aliases:
140+
141+
Required: True
142+
Position: Named
143+
Default value: None
144+
Accept pipeline input: False
145+
Accept wildcard characters: False
146+
```
147+
148+
### -JsonString
149+
Json string supplied to the Create operation
150+
151+
```yaml
152+
Type: System.String
153+
Parameter Sets: CreateViaJsonString
154+
Aliases:
155+
156+
Required: True
157+
Position: Named
158+
Default value: None
159+
Accept pipeline input: False
160+
Accept wildcard characters: False
161+
```
162+
118163
### -Name
119164
The name of the federated identity credential resource.
120165
@@ -151,7 +196,7 @@ The identifier of the external identity.
151196
152197
```yaml
153198
Type: System.String
154-
Parameter Sets: (All)
199+
Parameter Sets: CreateExpanded
155200
Aliases:
156201

157202
Required: False
@@ -214,7 +259,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
214259
215260
## OUTPUTS
216261
217-
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.Api20230131.IFederatedIdentityCredential
262+
### Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Models.IFederatedIdentityCredential
218263
219264
## NOTES
220265

0 commit comments

Comments
 (0)