Skip to content

Azure SDK Review - Intro to Storage STG 95 #7617

Open

Description

New SDK Review meeting has been requested.

Service Name: Xstore
Review Created By: Sean McCullough
Review Date: 06/25/2024 02:05 PM PT

Release Plan:
Hero Scenarios Link: N/A
Architecture Diagram Link: N/A
Core Concepts Doc Link: N/A
APIView Links: N/A

Description: Storage STG 95 feature intro

Detailed meeting information and documents provided can be accessed here

Champion Scenarios

  • Customers can now authenticate with Entra ID for all data plane File operations:
        [RecordedTest]
        [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2024_08_04)]
        public async Task CreateAsync_OAuth()
        {
            // Arrange
            var shareName = GetNewShareName();
            ShareServiceClient service = InstrumentationClient(
                new ShareServiceClient(new Uri("https://account.file.core.windows.net"),
                new DefaultAzureCredential()))
            ShareClient share = InstrumentClient(service.GetShareClient(shareName));

            try
            {
                // Act
                Response<ShareInfo> response = await share.CreateAsync(quotaInGB: 1);

                // Assert
                Assert.IsNotNull(response.GetRawResponse().Headers.RequestId);
                // Ensure that we grab the whole ETag value from the service without removing the quotes
                Assert.AreEqual(response.Value.ETag.ToString(), $"\"{response.GetRawResponse().Headers.ETag}\"");
            }
            finally
            {
                await share.DeleteAsync(false);
            }
        }
  • Customers can now set Paid Bursting, Paid Bursting Max IOPS, and Paid Bursting Max Bandwidth Mibps on Share Create and Share Set Properties. These properties can now be retrieved on Share Get Properties:
        [RecordedTest]
        [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2024_11_04)]
        public async Task CreateAsync_PaidBursting()
        {
            // Arrange
            var shareName = GetNewShareName();
            ShareServiceClient service = SharesClientBuilder.GetServiceClient_PremiumFile();
            ShareClient share = InstrumentClient(service.GetShareClient(shareName));
            ShareCreateOptions options = new ShareCreateOptions
            {
                EnablePaidBursting = true,
                PaidBurstingMaxIops = 5000,
                PaidBurstingMaxBandwidthMibps = 1000
            };

            try
            {
                // Act
                await share.CreateAsync(options);

                // Assert
                Response<ShareProperties> response = await share.GetPropertiesAsync();
                Assert.IsTrue(response.Value.EnablePaidBursting);
                Assert.AreEqual(5000, response.Value.PaidBurstingMaxIops);
                Assert.AreEqual(1000, response.Value.PaidBurstingMaxBandwidthMibps);

                // Act
                IList<ShareItem> shares = await service.GetSharesAsync().ToListAsync();
                ShareItem shareItem = shares.SingleOrDefault(r => r.Name == share.Name);

                // Assert
                Assert.IsTrue(shareItem.Properties.EnablePaidBursting);
                Assert.AreEqual(5000, shareItem.Properties.PaidBurstingMaxIops);
                Assert.AreEqual(1000, shareItem.Properties.PaidBurstingMaxBandwidthMibps);
            }
            finally
            {
                await share.DeleteAsync(false);
            }
        }
  • Customers can now specify the permission format for Share Get Permission:
        [RecordedTest]
        [TestCase(null)]
        [TestCase(FilePermissionKeyFormat.Sddl)]
        [TestCase(FilePermissionKeyFormat.Binary)]
        [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2024_11_04)]
        public async Task CreateAndGetPermissionAsync_FilePermissionKeyFormat(FilePermissionKeyFormat? filePermissionKeyFormat)
        {
            await using DisposingShare test = await GetTestShareAsync();
            ShareClient share = test.Share;

            // Arrange
            var permission = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-2127521184-1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;S-1-5-21-397955417-626881126-188441444-3053964)S:NO_ACCESS_CONTROL";

            // Act
            Response<PermissionInfo> createResponse = await share.CreatePermissionAsync(permission);
            Response<ShareFilePermission> getResponse = await share.GetPermissionAsync(createResponse.Value.FilePermissionKey, filePermissionKeyFormat);

            // Assert

            if (filePermissionKeyFormat == null || filePermissionKeyFormat == FilePermissionKeyFormat.Sddl)
            {
                Assert.AreEqual(permission, getResponse.Value.Permission);
                Assert.AreEqual(FilePermissionKeyFormat.Sddl, getResponse.Value.PermissionKeyFormat);
            }
            else
            {
                Assert.AreEqual(
                    "AQAUhGwAAACIAAAAAAAAABQAAAACAFgAAwAAAAAAFAD/AR8AAQEAAAAAAAUSAAAAAAAYAP8BHwABAgAAAAAABSAAAAAgAgAAAAAkAKkAEgABBQAAAAAABRUAAABZUbgXZnJdJWRjOwuMmS4AAQUAAAAAAAUVAAAAoGXPfnhLm1/nfIdwr/1IAQEFAAAAAAAFFQAAAKBlz354S5tf53yHcAECAAA=",
                    getResponse.Value.Permission);
            }
        }
  • Customers can now retrieve the String to Sign for debugging purposes on the *SasBuilders:
BlobSasBuilder sasBuilder = new BlobSasBuilder(BlobSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1));
string stringToSign = sasBuilder.GetStringToSign();

Open question: should we hide/mark as deprecate this new method? We don't want to encourage customers to call this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions