Ejemplo n.º 1
0
        public async Task Sas_BlobPublicAccess()
        {
            string path = StoragePath.Combine("test", Guid.NewGuid().ToString() + ".txt");

            await _native.WriteTextAsync(path, "read me!");

            var policy = new BlobSasPolicy(DateTime.UtcNow, TimeSpan.FromHours(12))
            {
                Permissions = BlobSasPermission.Read | BlobSasPermission.Write
            };

            string publicUrl = await _native.GetBlobSasAsync(path);

            Assert.NotNull(publicUrl);

            string text = await new HttpClient().GetStringAsync(publicUrl);

            Assert.Equal("read me!", text);
        }