Skip to content

Azure Storage Service sas token api version #19847

@bgelens

Description

@bgelens

Is your feature request related to a problem? Please describe.

I'm currently fetching a SAS token using:

$sas = az storage container generate-sas --account-name $storage.name --name test --auth-mode login --as-user --expiry ([System.DateTimeOffset]::UtcNow.AddHours(1).ToString("yyyy-MM-ddTHH:mmZ")) --https-only --permissions racwdl -o tsv

The generated sas works but is limited due to the api version used. Currently it uses 2018-11-09 while the latest I can find is 2020-10-02 See: https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services

The sas I currently get using az cli, will have some issues with my operation. I get CannotVerifyCopySource errors which are caused by authorization issues This request is not authorized to perform this operation.

When I generate the sas token in the portal and use that one, everything works fine. The api version used by the portal is higher 2020-08-04. All the rest of the sas arguments are the same.

Describe the solution you'd like

Please update the header version x-ms-version used by az cli to generate the token.

Describe alternatives you've considered

using az rest as intermediate but did not get it to work. Using the portal which is bad for automation. Using another route, e.g. sdk directly

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions