Fix Get-AzAccessToken breaking changes warning#1630
Merged
Conversation
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [PowerShell] Stop the Get-AzAccessToken breaking changes warning
Fix Get-AzAccessToken breaking changes warning
May 23, 2025
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
flanakin
reviewed
May 25, 2025
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
flanakin
previously requested changes
May 30, 2025
Co-authored-by: flanakin <399533+flanakin@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PowerShell commands in the FinOps toolkit were showing a warning about upcoming breaking changes in the
Get-AzAccessTokencmdlet:The
Start-FinOpsCostExportcommand was particularly affected since it makes multiple calls that triggered this warning.Changes
This PR addresses the warning by modifying the PowerShell module's implementation:
Invoke-Rest.ps1private function to correctly handle the upcoming changes toGet-AzAccessToken.Tokenproperty access from the SecureString returned byGet-AzAccessToken -AsSecureStringThe fix ensures compatibility with both current and future versions of the Az PowerShell module.
Fixes #987.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.