Azure / Azure/azure-cli

az storage account generate-sas creating invalid token (Expiry format incorrect)

Open
#11,190 16 comments 0 reactions 2 assignees Claimed by @calvinhzy View on GitHub
act-codegen-extensibility-squad AzCopy customer-reported feature-request Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

Expiry portion of the SAS token ends up like:
`se=2019-12-12T03%3A21%3A25Z`

Where it should be like:
`se=2019-12-12T03:21:25Z`

I have no idea where that format is valid but for most practical uses it seems like complete gibberish (e.g if passing token to azcopy)

Furthermore az cli should generate sas tokens in identical format to the Azure Portal for consistency sake.
Azure Portal generated SAS:
`?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2119-11-12T10:31:28Z&st=2019-11-12T02:31:28Z&spr=https&sig=REDACTED`

Azure CLI generated SAS:
`se=2019-12-12T03%3A21%3A25Z&sp=rwdlacup&sv=2018-03-28&ss=bqtf&srt=sco&sig=REDACTED`

**Command Name**
`az storage account generate-sas`

- `az storage account generate-sas --account-name {} --services {} --permissions {} --resource-type {} --expiry {} --output {}`

## Environment Summary
```
Linux-5.3.7-050307-generic-x86_64-with-debian-buster-sid
Python 3.6.5
Shell: bash

azure-cli 2.0.76

Extensions:
interactive 0.4.3

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.