-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Unable to list containers from CLI generated sas-token #26280
Copy link
Copy link
Open
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamStorageaz storageaz storageact-codegen-extensibility-squadact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.feature-request
Milestone
Metadata
Metadata
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamStorageaz storageaz storageact-codegen-extensibility-squadact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.feature-request
I am trying to create a bash shell script that lists containers in all my storage account. The problem is that the CLI generated sas token does not appear to be valid.
Here's what I am doing:
Results in:
st=2023-04-27T15%3A14%3A33Z&se=2023-05-27T15%3A14%3A23Z&sp=rwdlacup&sv=2018-03-28&ss=bqtf&srt=sco&sig=REDACTEDNow if try and list the containers with the CLI generated sas token:
az storage container list --account-name $storage_account_name --query "[].{name:name}" --output tsv --sas-token "?st=2023-04-27T15%3A14%3A33Z&se=2023-05-27T15%3A14%3A23Z&sp=rwdlacup&sv=2018-03-28&ss=bqtf&srt=sco&sig=REDACTED"I get:
But if I go into the Azure portal for the storage account and generate a sas from there I get:
?sv=2021-12-02&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2023-04-27T22:09:53Z&st=2023-04-27T14:09:53Z&spr=https&sig=REDACTEDNote the different order of the parameters and the date encoding differences.
Running exactly same command with the azure generated sas token works fine.
I expected that the CLI generated token should work no different than the token generated from the Azure portal.