Skip to content

Conversation

@lijinpei2008
Copy link
Contributor

…hell v3->v4

Description

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

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

@lijinpei2008
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

### CheckViaJsonFilePath
```
Test-AzConfidentialLedgerNameAvailability -JsonFilePath <String> [-SubscriptionId <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]

Choose a reason for hiding this comment

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

What is the schema of the JSON file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typically this type of structure would need to be provided by the service team and we cannot speculate on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typically, the default syntax of a command sends the request body that is formatted to be the value of this parameter.


### CheckViaJsonString
```
Test-AzConfidentialLedgerNameAvailability -JsonString <String> [-SubscriptionId <String>]

Choose a reason for hiding this comment

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

What is the schema of the Json string? Is there any guidance on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typically this type of structure would need to be provided by the service team and we cannot speculate on this.

@lijinpei2008 lijinpei2008 added the Contains Breaking Change This PR contains breaking change label Aug 18, 2025
@github-actions
Copy link

To the author of the pull request,
This PR was labeled "Breaking Change Release" because it contains breaking changes.

  • 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.

@lijinpei2008 lijinpei2008 marked this pull request as ready for review August 22, 2025 10:33
Copilot AI review requested due to automatic review settings August 22, 2025 10:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Azure ConfidentialLedger module generation tool from AutoRest PowerShell v3 to v4. The primary purpose is to modernize the code generation toolchain for the ConfidentialLedger module.

Key changes include:

  • Updated AutoRest PowerShell generation tool from v3 to v4
  • Simplified type definitions and parameter structures throughout the module
  • Updated Az.Accounts dependency version requirement

Reviewed Changes

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

Show a summary per file
File Description
tools/StaticAnalysis/Exceptions/Az.ConfidentialLedger/BreakingChangeIssues.csv Added breaking change exceptions for type changes introduced by the tool upgrade
src/ConfidentialLedger/ConfidentialLedger/Az.ConfidentialLedger.psd1 Updated Az.Accounts dependency version and generation date
src/ConfidentialLedger/ConfidentialLedger.sln Updated project GUID reference for generated project
src/ConfidentialLedger/ConfidentialLedger.Autorest/generate-info.json Updated generation ID for new tool version
src/ConfidentialLedger/ConfidentialLedger.Autorest/README.md Simplified configuration removing v3-specific settings and breaking change directives
Help files and PowerShell scripts Updated type references and documentation to reflect simplified type system


[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Support.LedgerType])]
[Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.PSArgumentCompleterAttribute("Unknown", "Public", "Private")]

Choose a reason for hiding this comment

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

Just curious. Why are enum changed to strings? E.g. LedgerType and LedgerRoleName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a tool-level modification, and nothing will change for the user in terms of how and what they enter.

## OUTPUTS
### Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Models.Api20220513.IConfidentialLedger
### Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Models.IConfidentialLedger

Choose a reason for hiding this comment

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

What is the reason for moving the models outside the Api version namespace? In my opinion, it could cause issues in the future as we wouldn't be able to make changes to the model without breaking the existing users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a change triggered by upgrading the autorest tool.
In the latest version of the tool, we have changed the rules for generating class namespaces, we have removed the intermediate level directory called version number.
This change does not have any impact on the actual usage by users.

Copy link

@msftsettiy msftsettiy Oct 31, 2025

Choose a reason for hiding this comment

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

Without version, what is the recommended way to introduce new changes in the SDK? For instance, we could change the IConfidentialLedger interface in a future version. How do we accomplish it without versioning?

Copy link
Contributor Author

@lijinpei2008 lijinpei2008 Oct 31, 2025

Choose a reason for hiding this comment

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

https://github.com/Azure/azure-powershell/blob/main/src/ConfidentialLedger/ConfidentialLedger.Autorest/README.md?plain=1#L36

We can confirm and change the Swagger API version at the location specified in this link.

Copy link

@msftsettiy msftsettiy left a comment

Choose a reason for hiding this comment

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

Left a few comments. please review

@isra-fel isra-fel added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label Oct 2, 2025
@Pan-Qi Pan-Qi requested a review from dolauli October 21, 2025 04:09
@dolauli dolauli added the Breaking change PR reviewed Add this label after a PR with breaking change has been reviewed and approved. label Oct 24, 2025
@dolauli
Copy link
Contributor

dolauli commented Oct 24, 2025

@lijinpei2008 While the changes look good to me, we'll hold on merging until early Nov. At the meantime, could you help authorize a markdown like this for each of the breaking change? We'll need it for publishing migration guides. Just leave a comment in the issue would be fine. Thank you!

## Az.Accounts

### `Get-AzAccessToken`

The default output type is changed from `PSAccessToken` to `PSSecureAccessToken`.That is to change plaintext `PSAccessToken.Token` to `SecureString PSSecureAccessToken.Token`

#### Before
```powershell
$authHeader = @{
    'Content-Type'  = 'application/json'
    'Authorization' = 'Bearer ' + (Get-AccessToken).Token
}
$response = Invoke-RestMethod -Method Get -Headers $authHeader -Uri $uri
```

#### After
```powershell
$secureToken = (Get-AzAccessToken).Token
$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureToken)
try {
     $plaintextToken = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)
} 
finally {
     [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) 
}
$authHeader = @{
    'Content-Type'  = 'application/json'
    'Authorization' = 'Bearer ' + $plaintextToken
}
$response = Invoke-RestMethod -Method Get -Headers $authHeader -Uri $uri
```

@dolauli dolauli added this to the Az 15.0.0 (11/18/2025) milestone Nov 4, 2025
@dolauli dolauli merged commit 64a9598 into main Nov 4, 2025
12 checks passed
@dolauli dolauli deleted the jinpei/main/ConfidentialLedger branch November 4, 2025 02:15
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 Breaking change PR reviewed Add this label after a PR with breaking change has been reviewed and approved. Contains Breaking Change This PR contains breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants