Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1.         private static void Do()
  2.         {
  3.             CloudStorageAccount storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=wtapocstorage;AccountKey=hpL+PSwgvcbxTM9mfjSxX3c0zeyitNmbTGNO29AK1Kzwz+wUg1I30gpr4s7tx1KCl1/Fjf/9Pi8ZNjh1KLLi/A==");
  4.  
  5.             // Create a new access policy for the account.
  6.             SharedAccessBlobPolicy policy = new SharedAccessBlobPolicy()
  7.             {
  8.                 Permissions = SharedAccessBlobPermissions.Read,
  9.                 SharedAccessExpiryTime = DateTime.UtcNow.AddHours(24),
  10.             };
  11.  
  12.             var client = storageAccount.CreateCloudBlobClient();
  13.             CloudBlobContainer container = client.GetContainerReference("asset-669ffb43-f058-4252-8fa5-5f0a9937bfde");
  14.             var blobRef = container.GetBlobReference("test-video_480x272_400.mp4");
  15.             var sig = blobRef.GetSharedAccessSignature(policy, null, null, null, new IPAddressOrRange("37.17.43.12"));
  16.             Console.WriteLine(blobRef.Uri + sig);
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement