I guess my answer is too late, but maybe someone else is looking for the same topic.
I had the same problem and found info only about "blobs", but after making a little research I could create this method in C# that returns the SAS url
First install the AzureStorage library to your project from the NuGet Management Tool
using Microsoft.Azure;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.File;
And here you have the code
public string GetFromUrl(string folder, string fileName)
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=yourStorageAcountName;AccountKey=yourKey");
CloudFileClient fileClient = storageAccount.CreateCloudFileClient();
Uri myUri = new Uri("https://yourAcount.file.core.windows.net/yourDirectory/"+ folder);
CloudFileDirectory directory = new CloudFileDirectory(myUri, storageAccount.Credentials);
var result = GetFileSasUri(directory, fileName);
return result;
}
static string GetFileSasUri(CloudFileDirectory container, string fileName)
{
CloudFile file = container.GetFileReference(fileName);
SharedAccessFilePolicy sasConstraints = new SharedAccessFilePolicy();
sasConstraints.SharedAccessStartTime = DateTime.UtcNow.AddMinutes(-5);
sasConstraints.SharedAccessExpiryTime = DateTime.UtcNow.AddHours(24);
sasConstraints.Permissions = SharedAccessFilePermissions.Read | SharedAccessFilePermissions.Write;
string sasBlobToken = file.GetSharedAccessSignature(sasConstraints);
SharedAccessFilePolicy sharedPolicy = new SharedAccessFilePolicy()
{
SharedAccessExpiryTime = DateTime.UtcNow.AddHours(24),
Permissions = SharedAccessFilePermissions.Write | SharedAccessFilePermissions.List | SharedAccessFilePermissions.Read
};
return file.Uri + sasBlobToken;
}
In this example the "Folder" parameter could be empty or should end with "/".
The file name, must have its extention (e.g audio.mp3)
Please notice that the link has an expiry date, but you can add hours, days, and even years for this ;)
Hope it could help you