Azure storage contains storage account, Container, blob, and so on, with the following specific relationships:
Our commonly used blob storage is stored in the container of the storage account.
There are currently three ways to share the contents of a BLOB with other users, in three ways:
1. Set the Container property as a public container
2. Set the Blob property to public public blob
Once set, the BLOB can be downloaded by wget.
3. File sharing over a certain period of time via SAS token
SAS is a shared access signature (SAS) that enables file sharing.
SAS Provider Service generates a SAS token by way of a bypass, through which the customer accesses the SAS token for a certain period of time.
The following will use PowerShell to generate SAS tokens to give customers access to the permissions.
There is a file:
Get-azurestorageblob-container Hengweisoft-blob GOOGLECHROME.DMG
Container Uri:https://portalvhds6mlqtd15wqmm7.blob.core.chinacloudapi.cn/hengweisoft
Name blobtype Length ContentType lastmodified snapshottime
---- -------- ------ ----------- ------------ ------------
GOOGLECHROME.DMG blockblob 65936251 application/octet-stream 2015/7/6 8:09:00 +00:00
Among them hengweisoft This container is the private container.
$startTime = Get-date
$endTime = $startTime. AddHours (2.0)
New-azurestorageblobsastoken-container Hengweisoft-blob googlechrome.dmg-permission rwd-starttime $startTime- Expirytime $endTime
This command allows you to generate a bunch of SAS tokens:
? sv=2015-02-21&sr=b&sig=ifn6jfoinalqpygkcksyiuieq58wdexxv2z52nx%2fdjs%3d&st=2016-02-05t09%3a36% 3a57z&se=2016-02-05t11%3a36%3a57z&sp=rwd
Connect this token to the URL of the blob:
Https://portalvhds6mlqtd15wqmm7.blob.core.chinacloudapi.cn/hengweisoft/googlechrome.dmg?sv=2015-02-21&sr=b &sig=ifn6jfoinalqpygkcksyiuieq58wdexxv2z52nx%2fdjs%3d&st=2016-02-05t09%3a36%3a57z&se=2016-02-05t11 %3a36%3a57z&sp=rwd
This file can be accessed within 2 hours without requiring authentication.
You can do this by:
wget https://portalvhds6mlqtd15wqmm7.blob.core.chinacloudapi.cn/hengweisoft/googlechrome.dmg?sv=2015-02-21& Sr=b&sig=ifn6jfoinalqpygkcksyiuieq58wdexxv2z52nx%2fdjs%3d&st=2016-02-05t09%3a36%3a57z&se= 2016-02-05t11%3a36%3a57z&sp=rwd
Get this file directly.
Create an Azure storage SAS token Access Azure blob file using PowerShell