Open bmc-msft opened 5 years ago
As SAS URLs can be fore the account, container, or blob, doing the parsing to identify the components provided in the URL would be needful.
Example, this would provide everything:
https://a.blob.core.windows.net/b/c?d
Example, this would provide just the account, token, and container name:
https://a.blob.core.windows.net/b?d
Example, this would provide just the account and token:
https://a.blob.core.windows.net/?d
In the Azure portal and Storage Explorer, when you generate a SAS token, you are given the option to use the generated SAS URL, which can include much of the details needed for the rest of the operations.
These are in the form:
This would simplify the use of Client::azure_sas() as well as provide some of the needed information when the SAS token is limited to a specific object, rather than container or storage account.
As an example, providing the SAS URL looks like this now:
Where parsing that information out (of which, Url::Options is already being used to parse the token), it could look like this:
Supporting SAS URLs significantly improves the ergonomics of user supplied storage locations. As an example, the javascript library supports these: