Skip to content

Conversation

wonwuakpa-msft
Copy link
Member

@wonwuakpa-msft wonwuakpa-msft commented Aug 28, 2025

Description

  • Feature / Bug Fix: (Brief description of the feature or issue being addressed)

  • Related Links:

    • Issues
    • Email Subject - "Compatibility Issue Between AzCopy 10.29.1 and Az.Accounts Versions < 5.0.0"

Type of Change

  • Bug fix
  • New feature
  • Documentation update required
  • Code quality improvement
  • Other (describe):

How Has This Been Tested?

Manually tested. I downgraded to an old Az.Account version 2.2.0, confirmed the error about AsSecureString was returned. Implemented the changes in this PR and validated login --login-type="pscred" works.

Thank you for your contribution to AzCopy!

Copy link
Contributor

@Copilot 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 adds backward compatibility support for older versions of Azure PowerShell accounts (specifically versions prior to Az.Accounts 5.0.0) by handling the absence of the -AsSecureString parameter in the Get-AzAccessToken command.

  • Adds retry logic to fall back to the older command format when -AsSecureString parameter is not supported
  • Implements error detection for the specific parameter mismatch error
  • Modifies the PowerShell command construction to support both old and new Az.Accounts versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants