Skip to content

Commit 7259733

Browse files
Migrate Portal from generation to main (#27071)
* Move Portal to main * Update ChangeLog.md --------- Co-authored-by: Yash <[email protected]>
1 parent 63cd140 commit 7259733

File tree

189 files changed

+9411
-5285
lines changed

Some content is hidden

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

189 files changed

+9411
-5285
lines changed

src/Portal/Portal.Autorest/Az.Portal.format.ps1xml

Lines changed: 312 additions & 52 deletions
Large diffs are not rendered by default.

src/Portal/Portal.Autorest/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ In this directory, run AutoRest:
3232
> see https://aka.ms/autorest
3333
3434
``` yaml
35-
commit: 0dd49a444195fef7f3555cad038cb7665cbd928c
35+
commit: 570ea717eb84ecf725399353d2b52a590353e589
3636
require:
3737
- $(this-folder)/../../readme.azure.noprofile.md
3838
input-file:
39-
- $(repo)/specification/portal/resource-manager/Microsoft.Portal/preview/2019-01-01-preview/portal.json
39+
- $(repo)/specification/portal/resource-manager/Microsoft.Portal/preview/2022-12-01-preview/portal.json
4040

4141
metadata:
4242
authors: Microsoft Corporation
@@ -73,6 +73,21 @@ directive:
7373
subject: Dashboard
7474
variant: ^Update$|^UpdateViaIdentity$
7575
remove: true
76-
76+
- from: swagger-document
77+
where: $.definitions.DashboardPropertiesWithProvisioningState.properties.metadata
78+
transform: >-
79+
return {
80+
"type": "object",
81+
"additionalProperties": {"type": "object"},
82+
"description": "The dashboard metadata."
83+
}
84+
- from: swagger-document
85+
where: $.definitions.DashboardProperties.properties.metadata
86+
transform: >-
87+
return {
88+
"type": "object",
89+
"additionalProperties": {"type": "object"},
90+
"description": "The dashboard metadata."
91+
}
7792
7893
```

src/Portal/Portal.Autorest/UX/Microsoft.Portal/dashboards.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "dashboards",
3-
"apiVersion": "2019-01-01-preview",
3+
"apiVersion": "2022-12-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.portal"
66
},

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

Lines changed: 14 additions & 3 deletions
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]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
15+
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
@@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
6767
$binFolder = Join-Path $PSScriptRoot 'bin'
6868
$objFolder = Join-Path $PSScriptRoot 'obj'
6969

70+
$isAzure = [System.Convert]::ToBoolean('true')
71+
7072
if(-not $Debugger) {
7173
Write-Host -ForegroundColor Green 'Cleaning build folders...'
7274
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -143,7 +145,7 @@ if($NoDocs) {
143145
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
144146
}
145147
$null = New-Item -ItemType Directory -Force -Path $docsFolder
146-
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
148+
$addComplexInterfaceInfo = !$isAzure
147149
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
148150
}
149151

@@ -169,4 +171,13 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
169171
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
170172
}
171173

172-
Write-Host -ForegroundColor Green '-------------Done-------------'
174+
if (-not $DisableAfterBuildTasks){
175+
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
176+
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
177+
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
178+
Write-Host -ForegroundColor Green 'Running after build tasks...'
179+
. $afterBuildTasksPath @afterBuildTasksArgs
180+
}
181+
}
182+
183+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Portal/Portal.Autorest/custom/New-AzPortalDashboard.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
function New-AzPortalDashboard {
18-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard])]
18+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard])]
1919
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='Medium')]
2020
param(
2121
[Parameter(ParameterSetName='CreateByFile', Mandatory)]
@@ -112,9 +112,9 @@ begin {
112112
if (Test-Path $dashboardPath)
113113
{
114114
$content = (Get-content -Path $dashboardPath)
115-
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.Dashboard]::FromJsonString($content)
115+
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.Dashboard]::FromJsonString($content)
116116
$PSBoundParameters.Remove('DashboardPath') | Out-Null
117-
$PSBoundParameters.Add('Dashboard', $deserializedContent) | Out-Null
117+
$PSBoundParameters.Add('Resource', $deserializedContent) | Out-Null
118118
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
119119
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
120120
$steppablePipeline.Begin($PSCmdlet)

src/Portal/Portal.Autorest/custom/Set-AzPortalDashboard.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
function Set-AzPortalDashboard {
18-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard])]
18+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard])]
1919
[CmdletBinding(SupportsShouldProcess, PositionalBinding=$false, ConfirmImpact='Medium')]
2020
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Description("Creates or updates a Dashboard.")]
2121
param(
@@ -112,9 +112,9 @@ begin {
112112
if (Test-Path $dashboardPath)
113113
{
114114
$content = (Get-content -Path $dashboardPath)
115-
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.Dashboard]::FromJsonString($content)
115+
$deserializedContent = [Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.Dashboard]::FromJsonString($content)
116116
$PSBoundParameters.Remove('DashboardPath') | Out-Null
117-
$PSBoundParameters.Add('Dashboard', $deserializedContent) | Out-Null
117+
$PSBoundParameters.Add('Resource', $deserializedContent) | Out-Null
118118
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
119119
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
120120
$steppablePipeline.Begin($PSCmdlet)

src/Portal/Portal.Autorest/exports/Get-AzPortalDashboard.ps1

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Get-AzPortalDashboard -ResourceGroupName my-rg -Name mydashboard
2727
.Inputs
2828
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.IPortalIdentity
2929
.Outputs
30-
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard
30+
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
3131
.Notes
3232
COMPLEX PARAMETER PROPERTIES
3333
@@ -36,14 +36,14 @@ To create the parameters described below, construct a hash table containing the
3636
INPUTOBJECT <IPortalIdentity>: Identity Parameter
3737
[DashboardName <String>]: The name of the dashboard.
3838
[Id <String>]: Resource identity path
39-
[ResourceGroupName <String>]: The name of the resource group.
40-
[SubscriptionId <String>]: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
39+
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
40+
[SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID.
4141
.Link
4242
https://learn.microsoft.com/powershell/module/az.portal/get-azportaldashboard
4343
#>
4444
function Get-AzPortalDashboard {
45-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard])]
46-
[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
45+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard])]
46+
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
4747
param(
4848
[Parameter(ParameterSetName='Get', Mandatory)]
4949
[Alias('DashboardName')]
@@ -53,10 +53,11 @@ param(
5353
${Name},
5454

5555
[Parameter(ParameterSetName='Get', Mandatory)]
56-
[Parameter(ParameterSetName='List', Mandatory)]
56+
[Parameter(ParameterSetName='List1', Mandatory)]
5757
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Path')]
5858
[System.String]
5959
# The name of the resource group.
60+
# The name is case insensitive.
6061
${ResourceGroupName},
6162

6263
[Parameter(ParameterSetName='Get')]
@@ -65,9 +66,8 @@ param(
6566
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Path')]
6667
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
6768
[System.String[]]
68-
# The Azure subscription ID.
69-
# This is a GUID-formatted string (e.g.
70-
# 00000000-0000-0000-0000-000000000000)
69+
# The ID of the target subscription.
70+
# The value must be an UUID.
7171
${SubscriptionId},
7272

7373
[Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
@@ -106,13 +106,6 @@ param(
106106
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
107107
${HttpPipelinePrepend},
108108

109-
[Parameter(ParameterSetName='Get')]
110-
[Parameter(ParameterSetName='GetViaIdentity')]
111-
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Runtime')]
112-
[System.Management.Automation.SwitchParameter]
113-
# Returns true when the command succeeds
114-
${PassThru},
115-
116109
[Parameter(DontShow)]
117110
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Runtime')]
118111
[System.Uri]

src/Portal/Portal.Autorest/exports/New-AzPortalDashboard.ps1

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,50 @@ Creates or updates a Dashboard.
2323
New-AzPortalDashboard -DashboardPath .\resources\dash1.json -ResourceGroupName mydash-rg -DashboardName my-dashboard03
2424
2525
.Inputs
26-
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard
26+
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard
28+
Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard
2929
.Notes
3030
COMPLEX PARAMETER PROPERTIES
3131
3232
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
3333
34-
DASHBOARD <IDashboard>: The shared dashboard resource definition.
35-
Location <String>: Resource location
36-
[Lens <IDashboardPropertiesLenses>]: The dashboard lenses.
37-
[(Any) <IDashboardLens>]: This indicates any property can be added to this object.
38-
[Metadata <IDashboardPropertiesMetadata>]: The dashboard metadata.
39-
[(Any) <Object>]: This indicates any property can be added to this object.
40-
[Tag <IDashboardTags>]: Resource tags
34+
LENS <IDashboardLens[]>: The dashboard lenses.
35+
Order <Int32>: The lens order.
36+
Part <IDashboardParts[]>: The dashboard parts.
37+
PositionColSpan <Int32>: The dashboard's part column span.
38+
PositionRowSpan <Int32>: The dashboard's part row span.
39+
PositionX <Int32>: The dashboard's part x coordinate.
40+
PositionY <Int32>: The dashboard's part y coordinate.
41+
[PositionMetadata <IAny>]: The dashboard part's metadata.
42+
[Metadata <IAny>]: The dashboard len's metadata.
43+
44+
RESOURCE <IDashboard>: The shared dashboard resource definition.
45+
Location <String>: The geo-location where the resource lives
46+
[Tag <ITrackedResourceTags>]: Resource tags.
4147
[(Any) <String>]: This indicates any property can be added to this object.
48+
[SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC).
49+
[SystemDataCreatedBy <String>]: The identity that created the resource.
50+
[SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource.
51+
[SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC)
52+
[SystemDataLastModifiedBy <String>]: The identity that last modified the resource.
53+
[SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource.
54+
[Lens <IDashboardLens[]>]: The dashboard lenses.
55+
Order <Int32>: The lens order.
56+
Part <IDashboardParts[]>: The dashboard parts.
57+
PositionColSpan <Int32>: The dashboard's part column span.
58+
PositionRowSpan <Int32>: The dashboard's part row span.
59+
PositionX <Int32>: The dashboard's part x coordinate.
60+
PositionY <Int32>: The dashboard's part y coordinate.
61+
[PositionMetadata <IAny>]: The dashboard part's metadata.
62+
[Metadata <IAny>]: The dashboard len's metadata.
63+
[Metadata <IDashboardPropertiesWithProvisioningStateMetadata>]: The dashboard metadata.
64+
[(Any) <Object>]: This indicates any property can be added to this object.
4265
.Link
4366
https://learn.microsoft.com/powershell/module/az.portal/new-azportaldashboard
4467
#>
4568
function New-AzPortalDashboard {
46-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard])]
69+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard])]
4770
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4871
param(
4972
[Parameter(Mandatory)]
@@ -57,49 +80,50 @@ param(
5780
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Path')]
5881
[System.String]
5982
# The name of the resource group.
83+
# The name is case insensitive.
6084
${ResourceGroupName},
6185

6286
[Parameter()]
6387
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Path')]
6488
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
6589
[System.String]
66-
# The Azure subscription ID.
67-
# This is a GUID-formatted string (e.g.
68-
# 00000000-0000-0000-0000-000000000000)
90+
# The ID of the target subscription.
91+
# The value must be an UUID.
6992
${SubscriptionId},
7093

7194
[Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)]
7295
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Body')]
73-
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboard]
96+
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboard]
7497
# The shared dashboard resource definition.
75-
# To construct, see NOTES section for DASHBOARD properties and create a hash table.
76-
${Dashboard},
98+
# To construct, see NOTES section for RESOURCE properties and create a hash table.
99+
${Resource},
77100

78101
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
79102
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Body')]
80103
[System.String]
81-
# Resource location
104+
# The geo-location where the resource lives
82105
${Location},
83106

84107
[Parameter(ParameterSetName='CreateExpanded')]
108+
[AllowEmptyCollection()]
85109
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Body')]
86-
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboardPropertiesLenses]))]
87-
[System.Collections.Hashtable]
110+
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboardLens[]]
88111
# The dashboard lenses.
112+
# To construct, see NOTES section for LENS properties and create a hash table.
89113
${Lens},
90114

91115
[Parameter(ParameterSetName='CreateExpanded')]
92116
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Body')]
93-
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboardPropertiesMetadata]))]
117+
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api20221201Preview.IDashboardPropertiesWithProvisioningStateMetadata]))]
94118
[System.Collections.Hashtable]
95119
# The dashboard metadata.
96120
${Metadata},
97121

98122
[Parameter(ParameterSetName='CreateExpanded')]
99123
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Category('Body')]
100-
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api201901Preview.IDashboardTags]))]
124+
[Microsoft.Azure.PowerShell.Cmdlets.Portal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Portal.Models.Api50.ITrackedResourceTags]))]
101125
[System.Collections.Hashtable]
102-
# Resource tags
126+
# Resource tags.
103127
${Tag},
104128

105129
[Parameter(ParameterSetName='CreateByFile', Mandatory)]

0 commit comments

Comments
 (0)