az storage account generate-sas --expiry precision
See original GitHub issueDescription
Attempting to generate a sas token with seconds precision fails:
az storage account generate-sas: error: argument --expiry: invalid datetime_type value: '2017-08-25T12:27:03'
In Powershell, the Get-Date cmdlet provides quick format options for SortableDateTimePattern and UniversalSortableDateTimePattern which both include seconds. Using these formats results in the error above.
Fails: 2017-08-25T12:27:03
Succeeds: 2017-08-25T12:27Z
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: interactive script
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here: 2.0.14
OS Version: What OS and version are you using?
Answer here: Mac OSX Sierra 10.12.6
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: Powershell on OSX
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
For anyone reading this - the following (in PowerShell) also works:
--expiry (Get-Date).AddMinutes(30).ToString("yyyy-MM-dTH:mZ")
Can you please help me how to auto generate the SAS Token for every 3 or 5 seconds through powershell and how the resources can access the auto generated SAS Token