Skip to content

Commit fe30631

Browse files
azure-pipelines[bot]azure-powershell-botlijinpei2008
authored
Migrate App from generation to main (#26140)
* Move App to main * update changelog * create BreakingChangeIssues.csv --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Jinpei Li <[email protected]>
1 parent b34384f commit fe30631

File tree

555 files changed

+12604
-2674
lines changed

Some content is hidden

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

555 files changed

+12604
-2674
lines changed

src/App/App.Autorest/Az.App.psm1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,41 @@
4747

4848
# Ask for the shared functionality table
4949
$VTable = Register-AzModule
50-
50+
5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
5353

5454
# Following two delegates are added for telemetry
5555
$instance.GetTelemetryId = $VTable.GetTelemetryId
5656
$instance.Telemetry = $VTable.Telemetry
57-
57+
58+
# Delegate to sanitize the output object
59+
$instance.SanitizeOutput = $VTable.SanitizerHandler
60+
61+
# Delegate to get the telemetry info
62+
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo
5863

5964
# Tweaks the pipeline per call
6065
$instance.OnNewRequest = $VTable.OnNewRequest
61-
66+
6267
# Gets shared parameter values
6368
$instance.GetParameterValue = $VTable.GetParameterValue
64-
69+
6570
# Allows shared module to listen to events from this module
6671
$instance.EventListener = $VTable.EventListener
67-
72+
6873
# Gets shared argument completers
6974
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70-
75+
7176
# The name of the currently selected Azure profile
7277
$instance.ProfileName = $VTable.ProfileName
7378

74-
7579
# Load the custom module
7680
$customModulePath = Join-Path $PSScriptRoot './custom/Az.App.custom.psm1'
7781
if(Test-Path $customModulePath) {
7882
$null = Import-Module -Name $customModulePath
7983
}
80-
84+
8185
# Export nothing to clear implicit exports
8286
Export-ModuleMember
8387

@@ -97,12 +101,12 @@
97101
# Load the last folder if no profile is selected
98102
$profileDirectory = $directories | Select-Object -Last 1
99103
}
100-
104+
101105
if($profileDirectory) {
102106
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103107
$exportsPath = $profileDirectory.FullName
104108
}
105-
109+
106110
if($exportsPath) {
107111
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108112
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath

src/App/App.Autorest/README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the App service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -63,6 +62,8 @@ identity-correction-for-post: true
6362
resourcegroup-append: true
6463
nested-object-to-string: true
6564
auto-switch-view: false
65+
disable-transform-identity-type: true
66+
flatten-userassignedidentity: false
6667

6768
use-extension:
6869
"@autorest/powershell": "4.x"
@@ -671,4 +672,24 @@ directive:
671672
verb: Remove
672673
subject: ContainerAppSourceControl
673674
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
674695
```

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
15+
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
@@ -177,4 +177,20 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
177177
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
178178
}
179179

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+
186+
if (-not $DisableAfterBuildTasks){
187+
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
188+
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
189+
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
190+
Write-Host -ForegroundColor Green 'Executing after build tasks...'
191+
. $afterBuildTasksPath @afterBuildTasksArgs
192+
}
193+
}
194+
195+
180196
Write-Host -ForegroundColor Green '-------------Done-------------'

src/App/App.Autorest/examples/New-AzContainerApp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $EnvId = (Get-AzContainerAppManagedEnv -ResourceGroupName azps_test_group_app -N
1010
1111
New-SelfSignedCertificate -DnsName "www.fabrikam.com", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My"
1212
Get-ChildItem -Path cert:\LocalMachine\My
13-
$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
13+
$mypwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
1414
Get-ChildItem -Path cert:\localMachine\my\F61C9A8C53D0500F819463A66C5921AA09E1B787 | Export-PfxCertificate -FilePath C:\mypfx.pfx -Password $mypwd
1515
New-AzContainerAppManagedEnvCert -EnvName azps-env -Name azps-env-cert -ResourceGroupName azps_test_group_app -Location eastus -InputFile "C:\mypfx.pfx" -Password $mypwd
1616
@@ -47,7 +47,7 @@ $EnvId = (Get-AzContainerAppConnectedEnv -ResourceGroupName azps_test_group_app
4747
4848
New-SelfSignedCertificate -DnsName "www.fabrikam.com", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My"
4949
Get-ChildItem -Path cert:\LocalMachine\My
50-
$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
50+
$mypwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
5151
Get-ChildItem -Path cert:\localMachine\my\F61C9A8C53D0500F819463A66C5921AA09E1B787 | Export-PfxCertificate -FilePath C:\mypfx.pfx -Password $mypwd
5252
New-AzContainerAppConnectedEnvCert -Name azps-connectedenvcert -ConnectedEnvironmentName azps-connectedenv -ResourceGroupName azps_test_group_app -Location eastus -InputFile "C:\mypfx.pfx" -Password $mypwd
5353

src/App/App.Autorest/examples/New-AzContainerAppConnectedEnvCert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
```powershell
33
New-SelfSignedCertificate -DnsName "www.fabrikam.com", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My"
44
Get-ChildItem -Path cert:\LocalMachine\My
5-
$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
5+
$mypwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
66
Get-ChildItem -Path cert:\localMachine\my\F61C9A8C53D0500F819463A66C5921AA09E1B787 | Export-PfxCertificate -FilePath C:\mypfx.pfx -Password $mypwd
77
88
New-AzContainerAppConnectedEnvCert -Name azps-connectedenvcert -ConnectedEnvironmentName azps-connectedenv -ResourceGroupName azps_test_group_app -Location eastus -InputFile "C:\mypfx.pfx" -Password $mypwd

src/App/App.Autorest/examples/New-AzContainerAppManagedEnvCert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
```powershell
33
New-SelfSignedCertificate -DnsName "www.fabrikam.com", "www.contoso.com" -CertStoreLocation "cert:\LocalMachine\My"
44
Get-ChildItem -Path cert:\LocalMachine\My
5-
$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
5+
$mypwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
66
Get-ChildItem -Path cert:\localMachine\my\F61C9A8C53D0500F819463A66C5921AA09E1B787 | Export-PfxCertificate -FilePath C:\mypfx.pfx -Password $mypwd
77
88
New-AzContainerAppManagedEnvCert -EnvName azps-env -Name azps-env-cert -ResourceGroupName azps_test_group_app -Location eastus -InputFile "C:\mypfx.pfx" -Password $mypwd

src/App/App.Autorest/examples/New-AzContainerAppSourceControl.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### Example 1: Create the SourceControl for a Container App.
22
```powershell
3-
$AzureClientSecret = ConvertTo-SecureString -String "1234" -Force -AsPlainText
4-
$RegistryPassword = ConvertTo-SecureString -String "1234" -Force -AsPlainText
5-
$GithubAccessToken = ConvertTo-SecureString -String "1234" -Force -AsPlainText
3+
$AzureClientSecret = ConvertTo-SecureString -String "****" -AsPlainText -Force
4+
$RegistryPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
5+
$GithubAccessToken = ConvertTo-SecureString -String "****" -AsPlainText -Force
66
77
New-AzContainerAppSourceControl -ContainerAppName azps-containerapp-1 -ResourceGroupName azps_test_group_app -Name current -AzureClientId "UserObjectId" -AzureClientSecret $AzureClientSecret -AzureKind "feaderated" -AzureTenantId "UserDirectoryID" -Branch "main" -GithubContextPath "./" -GithubAccessToken $GithubAccessToken -GithubConfigurationImage "azps-containerapp-1" -RegistryPassword $RegistryPassword -RegistryUrl "azpscontainerregistry.azurecr.io" -RegistryUserName "azpscontainerregistry" -RepoUrl "https://github.com/lijinpei2008/ghatest"
88
```

src/App/App.Autorest/examples/Update-AzContainerAppSourceControl.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### Example 1: Update source control for a Container App.
22
```powershell
3-
$AzureClientSecret = ConvertTo-SecureString -String "1234" -Force -AsPlainText
4-
$RegistryPassword = ConvertTo-SecureString -String "1234" -Force -AsPlainText
5-
$GithubAccessToken = ConvertTo-SecureString -String "1234" -Force -AsPlainText
3+
$AzureClientSecret = ConvertTo-SecureString -String "****" -AsPlainText -Force
4+
$RegistryPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
5+
$GithubAccessToken = ConvertTo-SecureString -String "****" -AsPlainText -Force
66
77
Update-AzContainerAppSourceControl -ContainerAppName azps-containerapp-1 -ResourceGroupName azps_test_group_app -Name current -AzureClientId "UserObjectId" -AzureClientSecret $AzureClientSecret -AzureKind "feaderated" -AzureTenantId "UserDirectoryID" -Branch "main" -GithubContextPath "./" -GithubAccessToken $GithubAccessToken -GithubConfigurationImage "azps-containerapp-1" -RegistryPassword $RegistryPassword -RegistryUrl "azpscontainerregistry.azurecr.io" -RegistryUserName "azpscontainerregistry" -RepoUrl "https://github.com/lijinpei2008/ghatest"
88
```
@@ -17,9 +17,9 @@ Update source control for a Container App.
1717

1818
### Example 2: Update source control for a Container App.
1919
```powershell
20-
$AzureClientSecret = ConvertTo-SecureString -String "1234" -Force -AsPlainText
21-
$RegistryPassword = ConvertTo-SecureString -String "1234" -Force -AsPlainText
22-
$GithubAccessToken = ConvertTo-SecureString -String "1234" -Force -AsPlainText
20+
$AzureClientSecret = ConvertTo-SecureString -String "****" -AsPlainText -Force
21+
$RegistryPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
22+
$GithubAccessToken = ConvertTo-SecureString -String "****" -AsPlainText -Force
2323
$sourcecontrol = Get-AzContainerAppSourceControl -ContainerAppName azps-containerapp-1 -ResourceGroupName azps_test_group_app -Name current
2424
2525
Update-AzContainerAppSourceControl -InputObject $sourcecontrol -AzureClientId "UserObjectId" -AzureClientSecret $AzureClientSecret -AzureKind "feaderated" -AzureTenantId "UserDirectoryID" -Branch "main" -GithubContextPath "./" -GithubAccessToken $GithubAccessToken -GithubConfigurationImage "azps-containerapp-1" -RegistryPassword $RegistryPassword -RegistryUrl "azpscontainerregistry.azurecr.io" -RegistryUserName "azpscontainerregistry" -RepoUrl "https://github.com/lijinpei2008/ghatest"
@@ -35,9 +35,9 @@ Update source control for a Container App.
3535

3636
### Example 3: Update source control for a Container App.
3737
```powershell
38-
$AzureClientSecret = ConvertTo-SecureString -String "1234" -Force -AsPlainText
39-
$RegistryPassword = ConvertTo-SecureString -String "1234" -Force -AsPlainText
40-
$GithubAccessToken = ConvertTo-SecureString -String "1234" -Force -AsPlainText
38+
$AzureClientSecret = ConvertTo-SecureString -String "****" -AsPlainText -Force
39+
$RegistryPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
40+
$GithubAccessToken = ConvertTo-SecureString -String "****" -AsPlainText -Force
4141
$containerapp = Get-AzContainerApp -ResourceGroupName azps_test_group_app -Name azps-containerapp-1
4242
4343
Update-AzContainerAppSourceControl -ContainerAppInputObject $containerapp -Name current -AzureClientId "UserObjectId" -AzureClientSecret $AzureClientSecret -AzureKind "feaderated" -AzureTenantId "UserDirectoryID" -Branch "main" -GithubContextPath "./" -GithubAccessToken $GithubAccessToken -GithubConfigurationImage "azps-containerapp-1" -RegistryPassword $RegistryPassword -RegistryUrl "azpscontainerregistry.azurecr.io" -RegistryUserName "azpscontainerregistry" -RepoUrl "https://github.com/lijinpei2008/ghatest"

src/App/App.Autorest/exports/Disable-AzContainerAppRevision.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ param(
112112
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
113113
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
114114
# Identity Parameter
115-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
116115
${InputObject},
117116

118117
[Parameter(ParameterSetName='DeactivateViaIdentityContainerApp', Mandatory, ValueFromPipeline)]
119118
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
120119
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
121120
# Identity Parameter
122-
# To construct, see NOTES section for CONTAINERAPPINPUTOBJECT properties and create a hash table.
123121
${ContainerAppInputObject},
124122

125123
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
DeactivateViaIdentityContainerApp = 'Az.App.private\Disable-AzContainerAppRevision_DeactivateViaIdentityContainerApp';
209207
}
210208
if (('Deactivate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Enable-AzContainerAppRevision.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ param(
112112
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
113113
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
114114
# Identity Parameter
115-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
116115
${InputObject},
117116

118117
[Parameter(ParameterSetName='ActivateViaIdentityContainerApp', Mandatory, ValueFromPipeline)]
119118
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
120119
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
121120
# Identity Parameter
122-
# To construct, see NOTES section for CONTAINERAPPINPUTOBJECT properties and create a hash table.
123121
${ContainerAppInputObject},
124122

125123
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
ActivateViaIdentityContainerApp = 'Az.App.private\Enable-AzContainerAppRevision_ActivateViaIdentityContainerApp';
209207
}
210208
if (('Activate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)