Skip to content

Commit a94ed58

Browse files
azure-pipelines[bot]azure-powershell-botlijinpei2008
authored
Migrate App from generation to main (Azure#26644)
* Move App to main * update changelog and BreakingChangeIssues.csv --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Jinpei Li <[email protected]>
1 parent 77a5299 commit a94ed58

File tree

256 files changed

+14515
-7759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+14515
-7759
lines changed

src/App/App.Autorest/README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ identity-correction-for-post: true
6262
resourcegroup-append: true
6363
nested-object-to-string: true
6464
auto-switch-view: false
65-
disable-transform-identity-type: true
65+
# Disable transform IdentityType as GET+PUT can not replace patch(https://github.com/Azure/autorest.powershell/blob/main/docs/migration-from-v3-to-v4.md#managed-identity-best-practice-alignment)
66+
# 1. ContainerApps_CreateOrUpdate and Jobs_CreateOrUpdate can not update resources
67+
# 2. the input schemas of PUT and PATCH are different
6668
flatten-userassignedidentity: false
67-
68-
use-extension:
69-
"@autorest/powershell": "4.x"
69+
disable-transform-identity-type: true
7070

7171
directive:
7272
- from: swagger-document
@@ -666,30 +666,22 @@ directive:
666666
- ResourceGroupName
667667
- DomainControlValidation
668668

669+
- where:
670+
verb: New|Update
671+
subject: ContainerApp
672+
hide: true
673+
- where:
674+
verb: New|Update
675+
subject: ContainerAppJob
676+
hide: true
677+
- from: UserAssignedIdentities.dictionary.cs
678+
where: $
679+
transform: $ = $.replace('null != property.Key && null != property.Value', 'null != property.Key');
680+
669681
# This command requires the user to provide the github token, but the command is missing this parameter,
670682
# so the command cannot be used normally. Wait for the next version to fix the problem
671683
- where:
672684
verb: Remove
673685
subject: ContainerAppSourceControl
674686
remove: true
675-
676-
##### announce upcoming MI-related breaking changes
677-
- where:
678-
parameter-name: IdentityType
679-
set:
680-
breaking-change:
681-
change-description: IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.
682-
deprecated-by-version: 2.0.0
683-
deprecated-by-azversion: 13.0.0
684-
change-effective-date: 2024/11/19
685-
- where:
686-
parameter-name: IdentityUserAssignedIdentity
687-
set:
688-
breaking-change:
689-
old-parameter-type: Hashtable
690-
new-parameter-type: string[]
691-
change-description: IdentityUserAssignedIdentity will be renamed to UserAssignedIdentity. And its type will be simplified as string array.
692-
deprecated-by-version: 2.0.0
693-
deprecated-by-azversion: 13.0.0
694-
change-effective-date: 2024/11/19
695687
```

src/App/App.Autorest/build-module.ps1

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ if(-not $NotIsolated -and -not $Debugger) {
7575
$binFolder = Join-Path $PSScriptRoot 'bin'
7676
$objFolder = Join-Path $PSScriptRoot 'obj'
7777

78+
$isAzure = [System.Convert]::ToBoolean('true')
79+
7880
if(-not $Debugger) {
7981
Write-Host -ForegroundColor Green 'Cleaning build folders...'
8082
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -151,7 +153,7 @@ if($NoDocs) {
151153
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
152154
}
153155
$null = New-Item -ItemType Directory -Force -Path $docsFolder
154-
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
156+
$addComplexInterfaceInfo = !$isAzure
155157
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
156158
}
157159

@@ -177,20 +179,13 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
177179
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
178180
}
179181

180-
$assemblyInfoPath = Join-Path $PSScriptRoot 'Properties' 'AssemblyInfo.cs'
181-
if (-not (Test-Path $assemblyInfoPath) -And [System.Convert]::ToBoolean('true')) {
182-
Write-Host -ForegroundColor Green 'Creating assembly info...'
183-
New-AssemblyInfo
184-
}
185-
186182
if (-not $DisableAfterBuildTasks){
187183
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
188184
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
189185
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
190-
Write-Host -ForegroundColor Green 'Executing after build tasks...'
186+
Write-Host -ForegroundColor Green 'Running after build tasks...'
191187
. $afterBuildTasksPath @afterBuildTasksArgs
192188
}
193189
}
194190

195-
196-
Write-Host -ForegroundColor Green '-------------Done-------------'
191+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/App/App.Autorest/custom/New-AzContainerApp.ps1

Lines changed: 540 additions & 0 deletions
Large diffs are not rendered by default.

src/App/App.Autorest/custom/New-AzContainerAppJob.ps1

Lines changed: 472 additions & 0 deletions
Large diffs are not rendered by default.

src/App/App.Autorest/custom/Update-AzContainerApp.ps1

Lines changed: 502 additions & 0 deletions
Large diffs are not rendered by default.

src/App/App.Autorest/custom/Update-AzContainerAppJob.ps1

Lines changed: 494 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.PowerShell.Cmdlets.App.Models
7+
{
8+
using Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json;
9+
using static Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Extensions;
10+
11+
/// <summary>
12+
/// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume
13+
/// group. The key is the ARM resource identifier of the identity.
14+
/// </summary>
15+
public partial class UserAssignedIdentities
16+
{
17+
partial void AfterToJson(ref JsonObject container)
18+
{
19+
if (this.__additionalProperties != null)
20+
{
21+
foreach (var key in this.__additionalProperties)
22+
{
23+
if (key.Value == null)
24+
{
25+
container.Add(key.Key, Runtime.Json.XNull.Instance);
26+
}
27+
}
28+
}
29+
}
30+
}
31+
}

src/App/App.Autorest/exports/New-AzContainerApp.ps1

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -235,26 +235,26 @@ function New-AzContainerApp {
235235
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
236236
param(
237237
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
238-
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
239238
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
239+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
240240
[Alias('ContainerAppName')]
241241
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
242242
[System.String]
243243
# Name of the Container App.
244244
${Name},
245245

246246
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
247-
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
248247
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
248+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
249249
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
250250
[System.String]
251251
# The name of the resource group.
252252
# The name is case insensitive.
253253
${ResourceGroupName},
254254

255255
[Parameter(ParameterSetName='CreateExpanded')]
256-
[Parameter(ParameterSetName='CreateViaJsonFilePath')]
257256
[Parameter(ParameterSetName='CreateViaJsonString')]
257+
[Parameter(ParameterSetName='CreateViaJsonFilePath')]
258258
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
259259
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
260260
[System.String]
@@ -305,21 +305,10 @@ param(
305305

306306
[Parameter(ParameterSetName='CreateExpanded')]
307307
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
308-
[Microsoft.Azure.PowerShell.Cmdlets.App.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
309308
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
310-
[System.String]
311-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
312-
${IdentityType},
313-
314-
[Parameter(ParameterSetName='CreateExpanded')]
315-
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
316-
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
317-
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.App.Models.IUserAssignedIdentities]))]
318-
[System.Collections.Hashtable]
319-
# The set of user assigned identities associated with the resource.
320-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
321-
# The dictionary values can be empty objects ({}) in requests.
322-
${IdentityUserAssignedIdentity},
309+
[System.Management.Automation.SwitchParameter]
310+
# Determines whether to enable a system-assigned identity for the resource.
311+
${EnableSystemAssignedIdentity},
323312

324313
[Parameter(ParameterSetName='CreateExpanded')]
325314
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
@@ -424,23 +413,32 @@ param(
424413

425414
[Parameter(ParameterSetName='CreateExpanded')]
426415
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
416+
[AllowEmptyCollection()]
427417
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
428-
[System.String]
429-
# Workload profile name to pin for container app execution.
430-
${WorkloadProfileName},
418+
[System.String[]]
419+
# The array of user assigned identities associated with the resource.
420+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
421+
${UserAssignedIdentity},
431422

432-
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
423+
[Parameter(ParameterSetName='CreateExpanded')]
424+
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
433425
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
434426
[System.String]
435-
# Path of Json file supplied to the Create operation
436-
${JsonFilePath},
427+
# Workload profile name to pin for container app execution.
428+
${WorkloadProfileName},
437429

438430
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
439431
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
440432
[System.String]
441433
# Json string supplied to the Create operation
442434
${JsonString},
443435

436+
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
437+
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
438+
[System.String]
439+
# Path of Json file supplied to the Create operation
440+
${JsonFilePath},
441+
444442
[Parameter()]
445443
[Alias('AzureRMContext', 'AzureCredential')]
446444
[ValidateNotNull()]
@@ -528,12 +526,12 @@ begin {
528526
}
529527

530528
$mapping = @{
531-
CreateExpanded = 'Az.App.private\New-AzContainerApp_CreateExpanded';
532-
CreateViaIdentityExpanded = 'Az.App.private\New-AzContainerApp_CreateViaIdentityExpanded';
533-
CreateViaJsonFilePath = 'Az.App.private\New-AzContainerApp_CreateViaJsonFilePath';
534-
CreateViaJsonString = 'Az.App.private\New-AzContainerApp_CreateViaJsonString';
529+
CreateExpanded = 'Az.App.custom\New-AzContainerApp';
530+
CreateViaJsonString = 'Az.App.custom\New-AzContainerApp';
531+
CreateViaJsonFilePath = 'Az.App.custom\New-AzContainerApp';
532+
CreateViaIdentityExpanded = 'Az.App.custom\New-AzContainerApp';
535533
}
536-
if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
534+
if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
537535
$testPlayback = $false
538536
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
539537
if ($testPlayback) {

src/App/App.Autorest/exports/New-AzContainerAppAuthConfig.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create the AuthConfig for a Container App.
19+
create the AuthConfig for a Container App.
2020
.Description
21-
Create the AuthConfig for a Container App.
21+
create the AuthConfig for a Container App.
2222
.Example
2323
$identity = New-AzContainerAppIdentityProviderObject -RegistrationAppId [email protected] -RegistrationAppSecretSettingName redis-config
2424

src/App/App.Autorest/exports/New-AzContainerAppConnectedEnv.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create an connectedEnvironment.
19+
create an connectedEnvironment.
2020
.Description
21-
Create an connectedEnvironment.
21+
create an connectedEnvironment.
2222
.Example
2323
New-AzContainerAppConnectedEnv -Name azps-connectedenv -ResourceGroupName azps_test_group_app -Location eastus -ExtendedLocationName "/subscriptions/{subId}/resourceGroups/azps_test_group_app/providers/Microsoft.ExtendedLocation/customLocations/my-custom-location" -ExtendedLocationType CustomLocation
2424

0 commit comments

Comments
 (0)