question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az storage account generate-sas --expiry precision

See original GitHub issue

Description

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

Similar to closed issue #1560


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:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
rohancraggcommented, Nov 20, 2018

I ended up using the SortableDateTimePattern and concatenating a ‘Z’ on the end.

For anyone reading this - the following (in PowerShell) also works:

--expiry (Get-Date).AddMinutes(30).ToString("yyyy-MM-dTH:mZ")

0reactions
sumanthkannedaricommented, Aug 2, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure an expiration policy for shared access signatures
Configure a policy on the storage account that defines the length of time that a shared access signature (SAS) should be valid.
Read more >
Azure - Securing Shared Access Signatures (SAS)
Just like expiry, it is vital that these permissions are accurate for ... az storage container generate-sas --account-name jsteststorage111 ...
Read more >
Storage Account SAS Tokens, Access Keys, And Connection ...
In this section, we are going to discuss how to generate a shared access signature (SAS) token for a storage account using Azure...
Read more >
Azure Storage: Is it possible to expire a SAS token before its ...
SAS tokens are essentially self-contained and cannot be altered once issued, so you cannot expire them early.
Read more >
Issues Addressed in SAS 9.4 (TS1M7) - Fix List
55155, PROC REG code that generates ODS Graphics output might take longer ... SAS ® 9.4 incorrectly reports that a valid license is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found