Skip to content

az redis export command returning parsing errors on PowerShell after 2.40.0 azure-cli version #24617

@austintolani

Description

@austintolani

Related command
az redis export

Describe the bug
After upgrading to azure-cli version greater than 2.40.0 the az redis export command is failing with the following parsing error:

PS C:\Users\austintolani> az redis export --container "<SAS URL>" --prefix "prefix" -g <rg name> -n <cache name> --file-format rdb
the following arguments are required: --prefix

I believe that this issue is due to the ampersand issue described here. Using the stop-parsing token (--%) solves the issue.

It looks like this is a PowerShell issue being tracked at PowerShell/PowerShell#1995 but I'm not sure what changes were introduced in 2.41.0 that would result in different behavior. Runing the identical command on PowerShell with version 2.40.0 does not produce any errors. Looking at the release notes for 2.41.0 I cannot see any related changes.
To Reproduce

  1. Create a premium Redis cache
  2. Create a container in storage account and copy the SAS URL
  3. Run the az redis export command with a version of azure-cli 2.41.0 or greater on PowerShell

Expected behavior
az redis export command, when passed a valid container URL, should not return any parsing errors
Environment summary

Install method - MSI
CLI version - 2.41.0,2.42.0
Shell Type - PowerShell

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions