Skip to content

generate-sas expiry example doesn't work on official docker image #23730

@devon-whil

Description

@devon-whil

This is autogenerated. Please review and update as needed.

Describe the bug

The following expiry example from here does not work on the official az cli docker image.

end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
sas=`az storage container generate-sas -n mycontainer --https-only --permissions dlrw --expiry $end -o tsv`
az storage blob upload -n MyBlob -c mycontainer -f file.txt --sas-token $sas

Command Name
This issue relates to the az storage container generate-sas command, but the problem in the example is with the date command.

Errors:

docker run -it mcr.microsoft.com/azure-cli:latest bash
bash-5.1# end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
date: invalid date '30 minutes'

To Reproduce:

See "Errors" section.

Expected Behavior

I expect a date example that works on the official docker image.

Environment Summary

Linux-5.10.25-linuxkit-x86_64-with, Alpine Linux v3.16
Python 3.10.5
Installer: DOCKER

azure-cli 2.39.0

Additional Context

None

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamCustomer UsageStorageaz storageact-codegen-extensibility-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions