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
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 tsvThe generated sas works but is limited due to the api version used. Currently it uses
2018-11-09while the latest I can find is2020-10-02See: https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-servicesThe sas I currently get using az cli, will have some issues with my operation. I get
CannotVerifyCopySourceerrors which are caused by authorization issuesThis 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-versionused 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