Skip to content

Migrate Kusto to autorest v4#28431

Merged
khang-11 merged 15 commits into
mainfrom
bernard-migrate-kusto-to-autorest-v4
May 20, 2026
Merged

Migrate Kusto to autorest v4#28431
khang-11 merged 15 commits into
mainfrom
bernard-migrate-kusto-to-autorest-v4

Conversation

@Pan-Qi

@Pan-Qi Pan-Qi commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

Description

Preannouncement PR: #29495

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@azure-client-tools-bot-prd

Copy link
Copy Markdown
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@isra-fel isra-fel added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label Oct 20, 2025
Copilot AI review requested due to automatic review settings January 12, 2026 08:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request migrates the Kusto PowerShell module from AutoRest v3 to AutoRest v4, introducing breaking changes primarily in cmdlet help documentation and API surface. The migration affects parameter types, parameter sets, model namespaces, and removes certain cmdlets related to private endpoints.

Changes:

  • Updates help documentation for all Kusto cmdlets with new parameter sets and type changes
  • Removes API version-specific namespaces from model references
  • Adds new parameter sets for JSON file/string inputs
  • Updates ChangeLog.md with breaking change notice
  • Removes three private endpoint-related cmdlet help files
  • Updates test files to use new model namespaces

Reviewed changes

Copilot reviewed 164 out of 164 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Kusto/Kusto/ChangeLog.md Added breaking change notice for AutoRest v4 migration
src/Kusto/Kusto/help/*.md (multiple) Updated cmdlet help with new parameter sets, type changes, and namespace updates
src/Kusto/Kusto/help/Remove-AzKustoPrivateEndpointConnection.md Removed entire file
src/Kusto/Kusto/help/New-AzKustoPrivateEndpointConnection.md Removed entire file
src/Kusto/Kusto/help/Get-AzKustoPrivateLinkResource.md Removed entire file
src/Kusto/Kusto/help/Get-AzKustoPrivateEndpointConnection.md Removed entire file
src/Kusto/Kusto.Autorest/test/Remove-AzKustoClusterCalloutPolicy.Tests.ps1 Updated model namespace references
src/Kusto/Kusto.Autorest/generate-info.json Updated generation ID

@Pan-Qi Pan-Qi added the Contains Breaking Change This PR contains breaking change label Jan 21, 2026
@github-actions

Copy link
Copy Markdown

To the author of the pull request,
This PR was labeled "Contains Breaking Change" because breaking changes have been detected by the static analysis pipeline.

  • According to our policy, breaking changes can only take place during major release and they must be preannounced.
  • Please follow our guide on the detailed steps.
  • Required: Please fill in the task below to facilitate our contact,you will receive notifications related to breaking changes.

Copilot AI review requested due to automatic review settings May 4, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@JiaSeng-v JiaSeng-v force-pushed the bernard-migrate-kusto-to-autorest-v4 branch from dc0fbce to 5d4e83c Compare May 4, 2026 06:24
Copilot AI review requested due to automatic review settings May 4, 2026 07:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 160 out of 164 changed files in this pull request and generated 4 comments.

Comment on lines +2 to +3
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken." No newline at end of file
- Additional information about change #1
-->
## Upcoming Release
* Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249).
- where:
variant: ^(Add|Check|Detach)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true

---
Module Name: Az.Kusto
Module Guid: 18c61846-f6f0-425e-ba4b-5cf903e2bdd8
Module Guid: 04ffad84-367b-441f-bb50-32480557d17e
Copilot AI review requested due to automatic review settings May 7, 2026 06:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 100 out of 232 changed files in this pull request and generated 6 comments.

Comment on lines +2 to +3
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
Comment on lines +37 to +38
$scriptContent | Out-File -FilePath (Join-Path $env:TEMP $blobName) -Encoding utf8 -Force
Set-AzStorageBlobContent -File (Join-Path $env:TEMP $blobName) -Container $containerName -Blob $blobName -Context $ctx -Force
Comment on lines +30 to +33
$storageAccountName = $env.storageAccountName
$containerName = "scripts"
$blobName = "update-script.kql"
if ($TestMode -ne 'playback') {
Comment on lines +1 to +21
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzKustoOperationsResultsLocation'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzKustoOperationsResultsLocation.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}

Describe 'Get-AzKustoOperationsResultsLocation' {
It 'GetViaIdentityLocation' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}
}
Comment on lines 97 to 99
It 'UpdateViaIdentityExpandedCMK' -skip{
$clusterName = $env.kustoClusterName
$resourceGroupName = $env.resourceGroupName
Comment on lines 39 to 41
It 'CreateWithCMK' -skip {
$name = "testdatabase" + $env.rstr6
$databaseFullName = $env.kustoClusterName + "/" + $name
@JiaSeng-v JiaSeng-v marked this pull request as ready for review May 7, 2026 08:09
Copilot AI review requested due to automatic review settings May 7, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 100 out of 232 changed files in this pull request and generated 3 comments.

@@ -94,7 +94,7 @@ Describe 'Update-AzKustoDatabase' {
{ Invoke-AzKustoDetachClusterFollowerDatabase -ResourceGroupName $resourceGroupName -ClusterName $clusterName -AttachedDatabaseConfigurationName $attachedDatabaseConfigurationName -ClusterResourceId $followerClusterResourceId } | Should -Not -Throw
}

It 'UpdateViaIdentityExpandedCMK' {
It 'UpdateViaIdentityExpandedCMK' -skip{
Comment on lines +49 to +53
forceUpdateTag = "tag2"
continueOnErrors = $true
scriptLevel = "Database"
principalPermissionsAction = "RemovePermissionOnScriptCompletion"
}
Comment on lines 20 to 22
## Upcoming Release
* Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249).
* Preannounced breaking changes. Please refer to https://go.microsoft.com/fwlink/?linkid=2333229
@Pan-Qi Pan-Qi self-assigned this May 8, 2026
Copilot AI review requested due to automatic review settings May 8, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 102 out of 234 changed files in this pull request and generated 8 comments.

Comment on lines +2 to +3
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
Comment on lines 1 to 4
### Example 1: Update an existing kusto script by name
```powershell
Update-AzKustoScript -DatabaseName mykustodatabase -Name newkustoscript -ClusterName testnewkustocluster -ResourceGroupName testrg -ScriptUrl $BlobSASURL -ScriptUrlSasToken $BlobSASToken -PrincipalPermissionsAction RemovePermissionOnScriptCompletion -ScriptLevel Database
Update-AzKustoScript -ClusterName $clusterName -DatabaseName $databaseName -Name $scriptName -ResourceGroupName $resourceGroupName -SubscriptionId $SubscriptionId -JsonString $jsonBody
```
Comment on lines +33 to +38
if ($TestMode -ne 'playback') {
$storageAccount = Get-AzStorageAccount -ResourceGroupName $env.resourceGroupName -Name $storageAccountName
$ctx = $storageAccount.Context
New-AzStorageContainer -Name $containerName -Context $ctx -Permission Off -ErrorAction SilentlyContinue
$scriptContent | Out-File -FilePath (Join-Path $env:TEMP $blobName) -Encoding utf8 -Force
Set-AzStorageBlobContent -File (Join-Path $env:TEMP $blobName) -Container $containerName -Blob $blobName -Context $ctx -Force
Comment on lines +17 to +22
Describe 'Update-AzKustoPrivateEndpointConnection' {
It 'UpdateExpanded' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'Update' -skip {
Comment on lines +17 to +20
Describe 'Get-AzKustoOperationsResultsLocation' {
It 'GetViaIdentityLocation' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}
Comment on lines 39 to 42
It 'CreateWithCMK' -skip {
$name = "testdatabase" + $env.rstr6
$databaseFullName = $env.kustoClusterName + "/" + $name
$keyVaultPropertyKeyName = $env.keyName
Comment on lines 187 to 190
## OUTPUTS

### System.String
### Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.IDiagnoseVirtualNetworkResult

Comment on lines 187 to 190
## OUTPUTS

### System.String
### Microsoft.Azure.PowerShell.Cmdlets.Kusto.Models.IDiagnoseVirtualNetworkResult

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

@YanaXu

YanaXu commented May 9, 2026

Copy link
Copy Markdown
Contributor

Don't merge this PR till the service team has done the test.

@YanaXu YanaXu self-assigned this May 9, 2026
@YanaXu

YanaXu commented May 15, 2026

Copy link
Copy Markdown
Contributor

Hi @Pan-Qi and @JiaSeng-v, please fix test errors.

@JiaSeng-v

Copy link
Copy Markdown
Contributor

Hi @Pan-Qi and @JiaSeng-v, please fix test errors.

Hi @YanaXu , we’ve requested the service team to help fix the test errors. It might take some time. Thanks

Copilot AI review requested due to automatic review settings May 19, 2026 01:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 101 out of 232 changed files in this pull request and generated 5 comments.

Comment on lines +2 to +3
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
"Az.Kusto","Update-AzKustoScript","1","1","Invalid_Parameter_Name","5011","1","Update-AzKustoScript -ScriptUrlSasToken is not a valid parameter name.","-ScriptUrlSasToken","Check validity of the parameter -ScriptUrlSasToken."
Comment on lines +37 to +38
$scriptContent | Out-File -FilePath (Join-Path $env:TEMP $blobName) -Encoding utf8 -Force
Set-AzStorageBlobContent -File (Join-Path $env:TEMP $blobName) -Container $containerName -Blob $blobName -Context $ctx -Force
Comment on lines +39 to +49
$sasToken = New-AzStorageBlobSASToken -Container $containerName -Blob $blobName -Context $ctx -Permission r -ExpiryTime (Get-Date).AddHours(1)
} else {
$sasToken = "?sv=faketoken"
}
$scriptUrl = "https://$storageAccountName.blob.core.windows.net/$containerName/$blobName"

$jsonBody = @{
properties = @{
scriptUrl = $scriptUrl
scriptUrlSasToken = $sasToken
forceUpdateTag = "tag2"
Comment on lines 20 to 22
## Upcoming Release
* Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249).
* Preannounced breaking changes. Please refer to https://go.microsoft.com/fwlink/?linkid=2333229
Comment on lines 1 to 4
### Example 1: Update an existing kusto script by name
```powershell
Update-AzKustoScript -DatabaseName mykustodatabase -Name newkustoscript -ClusterName testnewkustocluster -ResourceGroupName testrg -ScriptUrl $BlobSASURL -ScriptUrlSasToken $BlobSASToken -PrincipalPermissionsAction RemovePermissionOnScriptCompletion -ScriptLevel Database
Update-AzKustoScript -ClusterName $clusterName -DatabaseName $databaseName -Name $scriptName -ResourceGroupName $resourceGroupName -SubscriptionId $SubscriptionId -JsonString $jsonBody
```
Copilot AI review requested due to automatic review settings May 19, 2026 07:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 102 out of 233 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (4)

src/Kusto/Kusto.Autorest/test/Get-AzKustoOperationsResultsLocation.Tests.ps1:1

  • The cmdlet/test name uses Get-AzKustoOperationsResultsLocation (Results, plural), but the regenerated help/docs in this PR appear to be for Get-AzKustoOperationsResultLocation (Result, singular). If the actual cmdlet is singular, this test won't be discoverable/consistent and its recording filename will also be misnamed. Please align the test Describe, $TestName filter, and $TestRecordingFile to the real cmdlet name.
    src/Kusto/Kusto.Autorest/test/Get-AzKustoOperationsResultsLocation.Tests.ps1:1
  • The cmdlet/test name uses Get-AzKustoOperationsResultsLocation (Results, plural), but the regenerated help/docs in this PR appear to be for Get-AzKustoOperationsResultLocation (Result, singular). If the actual cmdlet is singular, this test won't be discoverable/consistent and its recording filename will also be misnamed. Please align the test Describe, $TestName filter, and $TestRecordingFile to the real cmdlet name.
    src/Kusto/Kusto.Autorest/examples/Update-AzKustoScript.md:1
  • This updated example references variables ($clusterName/$databaseName/$scriptName/$resourceGroupName/$SubscriptionId/$jsonBody) that aren’t defined in the example, so it’s not copy/paste runnable. Consider either using placeholder literals (e.g., <clusterName>) consistent with other examples, or expand the example to show how $jsonBody (including scriptUrl/scriptUrlSasToken) is constructed.
    src/Kusto/Kusto.Autorest/examples/Add-AzKustoClusterCalloutPolicy.md:1
  • The example still uses calloutUriRegex = \"*\", but related tests in this PR were updated to use \".*\" (valid regex). To avoid confusing users and to keep docs consistent with tests/service expectations, please update the example to a proper regex pattern (e.g., .*) if the field is truly regex-based.

Comment on lines +23 to +24
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.4.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.4.1")]
@khang-11 khang-11 self-requested a review May 20, 2026 01:33
@khang-11 khang-11 merged commit 3675fee into main May 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 Contains Breaking Change This PR contains breaking change Do Not Merge 🚫

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants