Skip to content

Commit

Permalink
Migrate App from generation to main (#26644)
Browse files Browse the repository at this point in the history
* Move App to main

* update changelog and BreakingChangeIssues.csv

---------

Co-authored-by: azure-powershell-bot <[email protected]>
Co-authored-by: Jinpei Li <[email protected]>
  • Loading branch information
3 people authored Nov 10, 2024
1 parent 77a5299 commit a94ed58
Show file tree
Hide file tree
Showing 256 changed files with 14,515 additions and 7,759 deletions.
40 changes: 16 additions & 24 deletions src/App/App.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ identity-correction-for-post: true
resourcegroup-append: true
nested-object-to-string: true
auto-switch-view: false
disable-transform-identity-type: true
# 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)
# 1. ContainerApps_CreateOrUpdate and Jobs_CreateOrUpdate can not update resources
# 2. the input schemas of PUT and PATCH are different
flatten-userassignedidentity: false

use-extension:
"@autorest/powershell": "4.x"
disable-transform-identity-type: true

directive:
- from: swagger-document
Expand Down Expand Up @@ -666,30 +666,22 @@ directive:
- ResourceGroupName
- DomainControlValidation

- where:
verb: New|Update
subject: ContainerApp
hide: true
- where:
verb: New|Update
subject: ContainerAppJob
hide: true
- from: UserAssignedIdentities.dictionary.cs
where: $
transform: $ = $.replace('null != property.Key && null != property.Value', 'null != property.Key');

# This command requires the user to provide the github token, but the command is missing this parameter,
# so the command cannot be used normally. Wait for the next version to fix the problem
- where:
verb: Remove
subject: ContainerAppSourceControl
remove: true

##### announce upcoming MI-related breaking changes
- where:
parameter-name: IdentityType
set:
breaking-change:
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.
deprecated-by-version: 2.0.0
deprecated-by-azversion: 13.0.0
change-effective-date: 2024/11/19
- where:
parameter-name: IdentityUserAssignedIdentity
set:
breaking-change:
old-parameter-type: Hashtable
new-parameter-type: string[]
change-description: IdentityUserAssignedIdentity will be renamed to UserAssignedIdentity. And its type will be simplified as string array.
deprecated-by-version: 2.0.0
deprecated-by-azversion: 13.0.0
change-effective-date: 2024/11/19
```
15 changes: 5 additions & 10 deletions src/App/App.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ if(-not $NotIsolated -and -not $Debugger) {
$binFolder = Join-Path $PSScriptRoot 'bin'
$objFolder = Join-Path $PSScriptRoot 'obj'

$isAzure = [System.Convert]::ToBoolean('true')

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

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

$assemblyInfoPath = Join-Path $PSScriptRoot 'Properties' 'AssemblyInfo.cs'
if (-not (Test-Path $assemblyInfoPath) -And [System.Convert]::ToBoolean('true')) {
Write-Host -ForegroundColor Green 'Creating assembly info...'
New-AssemblyInfo
}

if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Executing after build tasks...'
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'
Write-Host -ForegroundColor Green '-------------Done-------------'
540 changes: 540 additions & 0 deletions src/App/App.Autorest/custom/New-AzContainerApp.ps1

Large diffs are not rendered by default.

472 changes: 472 additions & 0 deletions src/App/App.Autorest/custom/New-AzContainerAppJob.ps1

Large diffs are not rendered by default.

502 changes: 502 additions & 0 deletions src/App/App.Autorest/custom/Update-AzContainerApp.ps1

Large diffs are not rendered by default.

494 changes: 494 additions & 0 deletions src/App/App.Autorest/custom/Update-AzContainerAppJob.ps1

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions src/App/App.Autorest/custom/UserAssignedIdentities.json.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

namespace Microsoft.Azure.PowerShell.Cmdlets.App.Models
{
using Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json;
using static Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Extensions;

/// <summary>
/// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this volume
/// group. The key is the ARM resource identifier of the identity.
/// </summary>
public partial class UserAssignedIdentities
{
partial void AfterToJson(ref JsonObject container)
{
if (this.__additionalProperties != null)
{
foreach (var key in this.__additionalProperties)
{
if (key.Value == null)
{
container.Add(key.Key, Runtime.Json.XNull.Instance);
}
}
}
}
}
}
54 changes: 26 additions & 28 deletions src/App/App.Autorest/exports/New-AzContainerApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -235,26 +235,26 @@ function New-AzContainerApp {
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Alias('ContainerAppName')]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
[System.String]
# Name of the Container App.
${Name},

[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
[System.String]
# The name of the resource group.
# The name is case insensitive.
${ResourceGroupName},

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaJsonFilePath')]
[Parameter(ParameterSetName='CreateViaJsonString')]
[Parameter(ParameterSetName='CreateViaJsonFilePath')]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
Expand Down Expand Up @@ -305,21 +305,10 @@ param(

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.App.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
[System.String]
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
${IdentityType},

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.App.Models.IUserAssignedIdentities]))]
[System.Collections.Hashtable]
# The set of user assigned identities associated with the resource.
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
# The dictionary values can be empty objects ({}) in requests.
${IdentityUserAssignedIdentity},
[System.Management.Automation.SwitchParameter]
# Determines whether to enable a system-assigned identity for the resource.
${EnableSystemAssignedIdentity},

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
Expand Down Expand Up @@ -424,23 +413,32 @@ param(

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

[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
[System.String]
# Path of Json file supplied to the Create operation
${JsonFilePath},
# Workload profile name to pin for container app execution.
${WorkloadProfileName},

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

[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Body')]
[System.String]
# Path of Json file supplied to the Create operation
${JsonFilePath},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -528,12 +526,12 @@ begin {
}

$mapping = @{
CreateExpanded = 'Az.App.private\New-AzContainerApp_CreateExpanded';
CreateViaIdentityExpanded = 'Az.App.private\New-AzContainerApp_CreateViaIdentityExpanded';
CreateViaJsonFilePath = 'Az.App.private\New-AzContainerApp_CreateViaJsonFilePath';
CreateViaJsonString = 'Az.App.private\New-AzContainerApp_CreateViaJsonString';
CreateExpanded = 'Az.App.custom\New-AzContainerApp';
CreateViaJsonString = 'Az.App.custom\New-AzContainerApp';
CreateViaJsonFilePath = 'Az.App.custom\New-AzContainerApp';
CreateViaIdentityExpanded = 'Az.App.custom\New-AzContainerApp';
}
if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
if ($testPlayback) {
Expand Down
4 changes: 2 additions & 2 deletions src/App/App.Autorest/exports/New-AzContainerAppAuthConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create the AuthConfig for a Container App.
create the AuthConfig for a Container App.
.Description
Create the AuthConfig for a Container App.
create the AuthConfig for a Container App.
.Example
$identity = New-AzContainerAppIdentityProviderObject -RegistrationAppId [email protected] -RegistrationAppSecretSettingName redis-config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create an connectedEnvironment.
create an connectedEnvironment.
.Description
Create an connectedEnvironment.
create an connectedEnvironment.
.Example
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a Certificate.
create a Certificate.
.Description
Create a Certificate.
create a Certificate.
.Example
New-SelfSignedCertificate -DnsName "www.fabrikam.com", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My"
Get-ChildItem -Path cert:\LocalMachine\My
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a Dapr Component in a connected environment.
create a Dapr Component in a connected environment.
.Description
Create a Dapr Component in a connected environment.
create a Dapr Component in a connected environment.
.Example
$scope = @("container-app-1","container-app-2")
$secretObject = New-AzContainerAppSecretObject -Name "masterkey" -Value "keyvalue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create storage for a connectedEnvironment.
create storage for a connectedEnvironment.
.Description
Create storage for a connectedEnvironment.
create storage for a connectedEnvironment.
.Example
New-AzStorageAccount -ResourceGroupName azps_test_group_app -AccountName azpstestsa -Location eastus -SkuName Standard_GRS
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName azps_test_group_app -AccountName azpstestsa).Value[0]
Expand Down
Loading

0 comments on commit a94ed58

Please sign in to comment.