Skip to content

Commit 44c216e

Browse files
azure-pipelines[bot]azure-powershell-botlijinpei2008
authored
Migrate Monitor from generation to main (#26567)
* Move Monitor to main * create BreakingChangeIssues.csv and update changelog * update changelog --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Jinpei Li <[email protected]>
1 parent 8349058 commit 44c216e

File tree

44 files changed

+1363
-770
lines changed

Some content is hidden

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

44 files changed

+1363
-770
lines changed

src/Monitor/ActivityLogAlert.Autorest/build-module.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
178180
}
179181
}
180182

181-
182-
Write-Host -ForegroundColor Green '-------------Done-------------'
183+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Monitor/Autoscale.Autorest/build-module.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
178180
}
179181
}
180182

181-
182-
Write-Host -ForegroundColor Green '-------------Done-------------'
183+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Monitor/DataCollectionRule.Autorest/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ title: DataCollectionRule
4343
module-version: 0.1.0
4444
namespace: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection
4545
subject-prefix: ''
46-
disable-transform-identity-type: true
47-
flatten-userassignedidentity: false
4846

4947
directive:
5048
# custom required body
@@ -191,24 +189,4 @@ directive:
191189
- model-name: StorageBlobDestination
192190
# string Name, string StorageAccountResourceId, string TableName
193191
- model-name: StorageTableDestination
194-
195-
##### announce upcoming MI-related breaking changes
196-
- where:
197-
parameter-name: IdentityType
198-
set:
199-
breaking-change:
200-
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.
201-
deprecated-by-version: 2.0.0
202-
deprecated-by-azversion: 13.0.0
203-
change-effective-date: 2024/11/19
204-
- where:
205-
parameter-name: UserAssignedIdentity
206-
set:
207-
breaking-change:
208-
old-parameter-type: Hashtable
209-
new-parameter-type: string[]
210-
change-description: UserAssignedIdentity's type will be simplified as string array.
211-
deprecated-by-version: 2.0.0
212-
deprecated-by-azversion: 13.0.0
213-
change-effective-date: 2024/11/19
214192
```

src/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionEndpoint.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ param(
7777
${Description},
7878

7979
[Parameter(ParameterSetName='CreateExpanded')]
80-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
8180
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
82-
[System.String]
83-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
84-
${IdentityType},
81+
[System.Management.Automation.SwitchParameter]
82+
# Determines whether to enable a system-assigned identity for the resource.
83+
${EnableSystemAssignedIdentity},
8584

8685
[Parameter(ParameterSetName='CreateExpanded')]
8786
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
@@ -112,12 +111,11 @@ param(
112111
${Tag},
113112

114113
[Parameter(ParameterSetName='CreateExpanded')]
114+
[AllowEmptyCollection()]
115115
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
116-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IUserAssignedIdentities]))]
117-
[System.Collections.Hashtable]
118-
# The set of user assigned identities associated with the resource.
119-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
120-
# The dictionary values can be empty objects ({}) in requests.
116+
[System.String[]]
117+
# The array of user assigned identities associated with the resource.
118+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
121119
${UserAssignedIdentity},
122120

123121
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]

src/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRule.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,10 @@ param(
374374
${DestinationStorageTablesDirect},
375375

376376
[Parameter(ParameterSetName='CreateExpanded')]
377-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
378377
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
379-
[System.String]
380-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
381-
${IdentityType},
378+
[System.Management.Automation.SwitchParameter]
379+
# Determines whether to enable a system-assigned identity for the resource.
380+
${EnableSystemAssignedIdentity},
382381

383382
[Parameter(ParameterSetName='CreateExpanded')]
384383
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("Linux", "Windows")]
@@ -402,12 +401,11 @@ param(
402401
${Tag},
403402

404403
[Parameter(ParameterSetName='CreateExpanded')]
404+
[AllowEmptyCollection()]
405405
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
406-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IUserAssignedIdentities]))]
407-
[System.Collections.Hashtable]
408-
# The set of user assigned identities associated with the resource.
409-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
410-
# The dictionary values can be empty objects ({}) in requests.
406+
[System.String[]]
407+
# The array of user assigned identities associated with the resource.
408+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
411409
${UserAssignedIdentity},
412410

413411
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]

src/Monitor/DataCollectionRule.Autorest/exports/ProxyCmdletDefinitions.ps1

Lines changed: 57 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,10 @@ param(
721721
${Description},
722722

723723
[Parameter(ParameterSetName='CreateExpanded')]
724-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
725724
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
726-
[System.String]
727-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
728-
${IdentityType},
725+
[System.Management.Automation.SwitchParameter]
726+
# Determines whether to enable a system-assigned identity for the resource.
727+
${EnableSystemAssignedIdentity},
729728

730729
[Parameter(ParameterSetName='CreateExpanded')]
731730
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
@@ -756,12 +755,11 @@ param(
756755
${Tag},
757756

758757
[Parameter(ParameterSetName='CreateExpanded')]
758+
[AllowEmptyCollection()]
759759
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
760-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IUserAssignedIdentities]))]
761-
[System.Collections.Hashtable]
762-
# The set of user assigned identities associated with the resource.
763-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
764-
# The dictionary values can be empty objects ({}) in requests.
760+
[System.String[]]
761+
# The array of user assigned identities associated with the resource.
762+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
765763
${UserAssignedIdentity},
766764

767765
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
@@ -1468,11 +1466,10 @@ param(
14681466
${DestinationStorageTablesDirect},
14691467

14701468
[Parameter(ParameterSetName='CreateExpanded')]
1471-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
14721469
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
1473-
[System.String]
1474-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
1475-
${IdentityType},
1470+
[System.Management.Automation.SwitchParameter]
1471+
# Determines whether to enable a system-assigned identity for the resource.
1472+
${EnableSystemAssignedIdentity},
14761473

14771474
[Parameter(ParameterSetName='CreateExpanded')]
14781475
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("Linux", "Windows")]
@@ -1496,12 +1493,11 @@ param(
14961493
${Tag},
14971494

14981495
[Parameter(ParameterSetName='CreateExpanded')]
1496+
[AllowEmptyCollection()]
14991497
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
1500-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IUserAssignedIdentities]))]
1501-
[System.Collections.Hashtable]
1502-
# The set of user assigned identities associated with the resource.
1503-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
1504-
# The dictionary values can be empty objects ({}) in requests.
1498+
[System.String[]]
1499+
# The array of user assigned identities associated with the resource.
1500+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
15051501
${UserAssignedIdentity},
15061502

15071503
[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
@@ -2249,9 +2245,9 @@ end {
22492245

22502246
<#
22512247
.Synopsis
2252-
update part of a data collection endpoint.
2248+
update a data collection endpoint.
22532249
.Description
2254-
update part of a data collection endpoint.
2250+
update a data collection endpoint.
22552251
.Example
22562252
Update-AzDataCollectionEndpoint -Name myCollectionEndpoint -ResourceGroupName AMCS-TEST -Tag @{"123"="abc"}
22572253
@@ -2308,26 +2304,51 @@ param(
23082304
${InputObject},
23092305

23102306
[Parameter()]
2311-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
23122307
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
23132308
[System.String]
2314-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
2315-
${IdentityType},
2309+
# Description of the data collection endpoint.
2310+
${Description},
2311+
2312+
[Parameter()]
2313+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2314+
[System.Nullable[System.Boolean]]
2315+
# Determines whether to enable a system-assigned identity for the resource.
2316+
${EnableSystemAssignedIdentity},
2317+
2318+
[Parameter()]
2319+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2320+
[System.String]
2321+
# The immutable ID of this data collection endpoint resource.
2322+
# This property is READ-ONLY.
2323+
${ImmutableId},
2324+
2325+
[Parameter()]
2326+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("Linux", "Windows")]
2327+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2328+
[System.String]
2329+
# The kind of the resource.
2330+
${Kind},
2331+
2332+
[Parameter()]
2333+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("Enabled", "Disabled", "SecuredByPerimeter")]
2334+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2335+
[System.String]
2336+
# The configuration to set whether network access from public internet to the endpoints are allowed.
2337+
${NetworkAclsPublicNetworkAccess},
23162338

23172339
[Parameter()]
23182340
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2319-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IResourceForUpdateTags]))]
2341+
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IDataCollectionEndpointResourceTags]))]
23202342
[System.Collections.Hashtable]
23212343
# Resource tags.
23222344
${Tag},
23232345

23242346
[Parameter()]
2347+
[AllowEmptyCollection()]
23252348
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2326-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IUserAssignedIdentities]))]
2327-
[System.Collections.Hashtable]
2328-
# The set of user assigned identities associated with the resource.
2329-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
2330-
# The dictionary values can be empty objects ({}) in requests.
2349+
[System.String[]]
2350+
# The array of user assigned identities associated with the resource.
2351+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
23312352
${UserAssignedIdentity},
23322353

23332354
[Parameter()]
@@ -2977,11 +2998,10 @@ param(
29772998
${DestinationStorageTablesDirect},
29782999

29793000
[Parameter()]
2980-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")]
29813001
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
2982-
[System.String]
2983-
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
2984-
${IdentityType},
3002+
[System.Nullable[System.Boolean]]
3003+
# Determines whether to enable a system-assigned identity for the resource.
3004+
${EnableSystemAssignedIdentity},
29853005

29863006
[Parameter()]
29873007
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.PSArgumentCompleterAttribute("Linux", "Windows")]
@@ -3005,12 +3025,11 @@ param(
30053025
${Tag},
30063026

30073027
[Parameter()]
3028+
[AllowEmptyCollection()]
30083029
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Category('Body')]
3009-
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models.IUserAssignedIdentities]))]
3010-
[System.Collections.Hashtable]
3011-
# The set of user assigned identities associated with the resource.
3012-
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
3013-
# The dictionary values can be empty objects ({}) in requests.
3030+
[System.String[]]
3031+
# The array of user assigned identities associated with the resource.
3032+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
30143033
${UserAssignedIdentity},
30153034

30163035
[Parameter()]

0 commit comments

Comments
 (0)