Skip to content

Commit

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

* Update ChangeLog.md

---------

Co-authored-by: Yabo Hu <[email protected]>
  • Loading branch information
azure-powershell-bot and VeryEarly authored Dec 6, 2024
1 parent 89c87bf commit e6142d5
Show file tree
Hide file tree
Showing 914 changed files with 41,457 additions and 19,990 deletions.
510 changes: 340 additions & 170 deletions src/Kusto/Kusto.Autorest/Az.Kusto.format.ps1xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Kusto/Kusto.Autorest/Az.Kusto.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Kusto.private.dll'
FormatsToProcess = './Az.Kusto.format.ps1xml'
FunctionsToExport = 'Add-AzKustoClusterLanguageExtension', 'Add-AzKustoDatabasePrincipal', 'Get-AzKustoAttachedDatabaseConfiguration', 'Get-AzKustoCluster', 'Get-AzKustoClusterFollowerDatabase', 'Get-AzKustoClusterLanguageExtension', 'Get-AzKustoClusterOutboundNetworkDependencyEndpoint', 'Get-AzKustoClusterPrincipalAssignment', 'Get-AzKustoClusterSku', 'Get-AzKustoDatabase', 'Get-AzKustoDatabasePrincipal', 'Get-AzKustoDatabasePrincipalAssignment', 'Get-AzKustoDataConnection', 'Get-AzKustoManagedPrivateEndpoint', 'Get-AzKustoOperationsResult', 'Get-AzKustoOperationsResultLocation', 'Get-AzKustoPrivateEndpointConnection', 'Get-AzKustoPrivateLinkResource', 'Get-AzKustoSandboxCustomImage', 'Get-AzKustoScript', 'Get-AzKustoSku', 'Invoke-AzKustoClusterMigration', 'Invoke-AzKustoDataConnectionValidation', 'Invoke-AzKustoDetachClusterFollowerDatabase', 'Invoke-AzKustoDiagnoseClusterVirtualNetwork', 'Invoke-AzKustoInviteDatabaseFollower', 'New-AzKustoAttachedDatabaseConfiguration', 'New-AzKustoCluster', 'New-AzKustoClusterPrincipalAssignment', 'New-AzKustoDatabase', 'New-AzKustoDatabasePrincipalAssignment', 'New-AzKustoDataConnection', 'New-AzKustoManagedPrivateEndpoint', 'New-AzKustoPrivateEndpointConnection', 'New-AzKustoSandboxCustomImage', 'New-AzKustoScript', 'Remove-AzKustoAttachedDatabaseConfiguration', 'Remove-AzKustoCluster', 'Remove-AzKustoClusterLanguageExtension', 'Remove-AzKustoClusterPrincipalAssignment', 'Remove-AzKustoDatabase', 'Remove-AzKustoDatabasePrincipal', 'Remove-AzKustoDatabasePrincipalAssignment', 'Remove-AzKustoDataConnection', 'Remove-AzKustoManagedPrivateEndpoint', 'Remove-AzKustoPrivateEndpointConnection', 'Remove-AzKustoSandboxCustomImage', 'Remove-AzKustoScript', 'Start-AzKustoCluster', 'Stop-AzKustoCluster', 'Test-AzKustoAttachedDatabaseConfigurationNameAvailability', 'Test-AzKustoClusterNameAvailability', 'Test-AzKustoClusterPrincipalAssignmentNameAvailability', 'Test-AzKustoDatabaseNameAvailability', 'Test-AzKustoDatabasePrincipalAssignmentNameAvailability', 'Test-AzKustoDataConnectionNameAvailability', 'Test-AzKustoManagedPrivateEndpointNameAvailability', 'Test-AzKustoSandboxCustomImageNameAvailability', 'Test-AzKustoScriptNameAvailability', 'Update-AzKustoCluster', 'Update-AzKustoDatabase', 'Update-AzKustoDataConnection', 'Update-AzKustoManagedPrivateEndpoint', 'Update-AzKustoSandboxCustomImage', 'Update-AzKustoScript', '*'
FunctionsToExport = 'Add-AzKustoClusterCalloutPolicy', 'Add-AzKustoClusterLanguageExtension', 'Add-AzKustoDatabasePrincipal', 'Get-AzKustoAttachedDatabaseConfiguration', 'Get-AzKustoCluster', 'Get-AzKustoClusterCalloutPolicy', 'Get-AzKustoClusterFollowerDatabase', 'Get-AzKustoClusterFollowerDatabaseGet', 'Get-AzKustoClusterLanguageExtension', 'Get-AzKustoClusterOutboundNetworkDependencyEndpoint', 'Get-AzKustoClusterPrincipalAssignment', 'Get-AzKustoClusterSku', 'Get-AzKustoDatabase', 'Get-AzKustoDatabasePrincipal', 'Get-AzKustoDatabasePrincipalAssignment', 'Get-AzKustoDataConnection', 'Get-AzKustoManagedPrivateEndpoint', 'Get-AzKustoOperationsResult', 'Get-AzKustoOperationsResultLocation', 'Get-AzKustoPrivateEndpointConnection', 'Get-AzKustoPrivateLinkResource', 'Get-AzKustoSandboxCustomImage', 'Get-AzKustoScript', 'Get-AzKustoSku', 'Invoke-AzKustoClusterMigration', 'Invoke-AzKustoDataConnectionValidation', 'Invoke-AzKustoDetachClusterFollowerDatabase', 'Invoke-AzKustoDiagnoseClusterVirtualNetwork', 'Invoke-AzKustoInviteDatabaseFollower', 'New-AzKustoAttachedDatabaseConfiguration', 'New-AzKustoCluster', 'New-AzKustoClusterPrincipalAssignment', 'New-AzKustoDatabase', 'New-AzKustoDatabasePrincipalAssignment', 'New-AzKustoDataConnection', 'New-AzKustoManagedPrivateEndpoint', 'New-AzKustoPrivateEndpointConnection', 'New-AzKustoSandboxCustomImage', 'New-AzKustoScript', 'Remove-AzKustoAttachedDatabaseConfiguration', 'Remove-AzKustoCluster', 'Remove-AzKustoClusterCalloutPolicy', 'Remove-AzKustoClusterLanguageExtension', 'Remove-AzKustoClusterPrincipalAssignment', 'Remove-AzKustoDatabase', 'Remove-AzKustoDatabasePrincipal', 'Remove-AzKustoDatabasePrincipalAssignment', 'Remove-AzKustoDataConnection', 'Remove-AzKustoManagedPrivateEndpoint', 'Remove-AzKustoPrivateEndpointConnection', 'Remove-AzKustoSandboxCustomImage', 'Remove-AzKustoScript', 'Start-AzKustoCluster', 'Stop-AzKustoCluster', 'Test-AzKustoAttachedDatabaseConfigurationNameAvailability', 'Test-AzKustoClusterNameAvailability', 'Test-AzKustoClusterPrincipalAssignmentNameAvailability', 'Test-AzKustoDatabaseNameAvailability', 'Test-AzKustoDatabasePrincipalAssignmentNameAvailability', 'Test-AzKustoDataConnectionNameAvailability', 'Test-AzKustoManagedPrivateEndpointNameAvailability', 'Test-AzKustoSandboxCustomImageNameAvailability', 'Test-AzKustoScriptNameAvailability', 'Update-AzKustoCluster', 'Update-AzKustoDatabase', 'Update-AzKustoDataConnection', 'Update-AzKustoManagedPrivateEndpoint', 'Update-AzKustoSandboxCustomImage', 'Update-AzKustoScript', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{
Expand Down
6 changes: 3 additions & 3 deletions src/Kusto/Kusto.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ require:
- $(this-folder)/../../readme.azure.noprofile.md
# lock the commit
input-file:
- $(repo)/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2023-08-15/kusto.json
commit: 4c38cb9966cd6afbb03c7e9b14997720a728baee
- $(repo)/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2024-04-13/kusto.json
commit: 9a38736f10946d4e41ea40b3ba43d85a738f3263

```
Expand Down Expand Up @@ -150,5 +150,5 @@ directive:
# Correct some generated code
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.IDataConnection Property', 'public Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.IDataConnection Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.IDataConnection Property', 'public Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.IDataConnection Property');
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/AttachedDatabaseConfigurations",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/Databases/DataConnections",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/Databases/PrincipalAssignments",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/Databases/scripts",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/Databases",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/PrincipalAssignments",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/managedPrivateEndpoints",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/privateEndpointConnections",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/privateLinkResources",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters/sandboxCustomImages",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
40 changes: 39 additions & 1 deletion src/Kusto/Kusto.Autorest/UX/Microsoft.Kusto/Clusters.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "Clusters",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down Expand Up @@ -119,6 +119,44 @@
}
]
},
{
"name": "Remove-AzKustoClusterCalloutPolicy",
"description": "Removes callout policy for engine services.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/Clusters/{clusterName}/removeCalloutPolicy",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto/remove-azkustoclustercalloutpolicy"
},
"parameterSets": [
{
"parameters": [
"-ClusterName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Removes callout policy for engine services.",
"parameters": [
{
"name": "-ClusterName",
"value": "[Path.clusterName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzKustoCluster",
"description": "Deletes a Kusto cluster.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "locations/operationResults",
"apiVersion": "2023-08-15",
"apiVersion": "2024-04-13",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.kusto"
},
Expand Down
17 changes: 14 additions & 3 deletions src/Kusto/Kusto.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down Expand Up @@ -67,6 +67,8 @@ if(-not $Isolated -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 @@ -143,7 +145,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 @@ -169,4 +171,13 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

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

Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Checks that the data connection parameters are valid.
.Description
Checks that the data connection parameters are valid.
.Example
$dataConnectionProperties = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.EventHubDataConnection -Property @{Location=$location; Kind=$kind; EventHubResourceId=$eventHubResourceId; DataFormat=$dataFormat; ConsumerGroup='Default'; Compression= "None"; TableName = $tableName; MappingRuleName = $tableMappingName}
$dataConnectionValidation = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.DataConnectionValidation -Property @{DataConnectionName=$dataConnectionName; Property=$dataConnectionProperties}
$dataConnectionProperties = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.EventHubDataConnection -Property @{Location=$location; Kind=$kind; EventHubResourceId=$eventHubResourceId; DataFormat=$dataFormat; ConsumerGroup='Default'; Compression= "None"; TableName = $tableName; MappingRuleName = $tableMappingName}
$dataConnectionValidation = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.DataConnectionValidation -Property @{DataConnectionName=$dataConnectionName; Property=$dataConnectionProperties}
Invoke-AzKustoDataConnectionValidation -ResourceGroupName $resourceGroupName -ClusterName $clusterName -DatabaseName $databaseName -Parameter $dataConnectionValidation
ErrorMessage
Expand All @@ -31,7 +31,7 @@ event hub resource id and consumer group tuple provided are already used
https://learn.microsoft.com/powershell/module/az.kusto/invoke-azkustodataconnectionvalidation
#>
function Invoke-AzKustoDataConnectionValidation {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.IDataConnectionValidationResult])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.IDataConnectionValidationResult])]
[CmdletBinding(DefaultParameterSetName = 'DataExpandedEventHub', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'DataExpandedEventHub', Mandatory)]
Expand Down Expand Up @@ -267,13 +267,13 @@ function Invoke-AzKustoDataConnectionValidation {

process {
try {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.DataConnectionValidation]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.DataConnectionValidation]::new()

$Parameter.DataConnectionName = $PSBoundParameters['DataConnectionName']
$null = $PSBoundParameters.Remove('DataConnectionName')

if ($PSBoundParameters['Kind'] -eq 'EventHub') {
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.EventHubDataConnection]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.EventHubDataConnection]::new()

$Parameter.Property.EventHubResourceId = $PSBoundParameters['EventHubResourceId']
$null = $PSBoundParameters.Remove('EventHubResourceId')
Expand Down Expand Up @@ -304,7 +304,7 @@ function Invoke-AzKustoDataConnectionValidation {
}
}
elseif ($PSBoundParameters['Kind'] -eq 'EventGrid') {
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.EventGridDataConnection]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.EventGridDataConnection]::new()

$Parameter.Property.EventHubResourceId = $PSBoundParameters['EventHubResourceId']
$null = $PSBoundParameters.Remove('EventHubResourceId')
Expand Down Expand Up @@ -338,7 +338,7 @@ function Invoke-AzKustoDataConnectionValidation {
}
}
else {
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20230815.IotHubDataConnection]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.Api20240413.IotHubDataConnection]::new()

$Parameter.Property.IotHubResourceId = $PSBoundParameters['IotHubResourceId']
$null = $PSBoundParameters.Remove('IotHubResourceId')
Expand Down
Loading

0 comments on commit e6142d5

Please sign in to comment.